move applyDefaults up to be next to (related) getParameterString()

git-svn-id: http://svn.openlayers.org/trunk/openlayers@490 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-06-01 10:33:53 +00:00
parent f4e4541235
commit 128825886e

View File

@@ -784,6 +784,25 @@ OpenLayers.Util.createAlphaImageDiv = function(id, px, sz, imgURL,
return div;
};
/** Takes a hash and copies any keys that don't exist from
* another hash, by analogy with Object.extend() from
* Prototype.js.
*
* @param {Object} to
* @param {Object} from
*
* @type Object
*/
OpenLayers.Util.applyDefaults = function (to, from) {
for (var key in from) {
if (to[key] == null) {
to[key] = from[key];
}
}
return to;
};
/**
* @param {Object} params
*
@@ -814,24 +833,6 @@ OpenLayers.Util.getImagesLocation = function() {
return OpenLayers._getScriptLocation() + "img/";
};
/** Takes a hash and copies any keys that don't exist from
* another hash, by analogy with Object.extend() from
* Prototype.js.
*
* @param {Object} to
* @param {Object} from
*
* @type Object
*/
OpenLayers.Util.applyDefaults = function (to, from) {
for (var key in from) {
if (to[key] == null) {
to[key] = from[key];
}
}
return to;
};
/** These could/should be made namespace aware?