add OpenLayers.Util.upperCaseObject() function and test
git-svn-id: http://svn.openlayers.org/trunk/openlayers@491 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -785,6 +785,23 @@ OpenLayers.Util.createAlphaImageDiv = function(id, px, sz, imgURL,
|
||||
};
|
||||
|
||||
|
||||
/** Creates a new hash and copies over all the keys from the
|
||||
* passed-in object, but storing them under an uppercased
|
||||
* version of the key at which they were stored.
|
||||
*
|
||||
* @param {Object} object
|
||||
*
|
||||
* @returns A new Object with all the same keys but uppercased
|
||||
* @type Object
|
||||
*/
|
||||
OpenLayers.Util.upperCaseObject = function (object) {
|
||||
var uObject = new Object();
|
||||
for (var key in object) {
|
||||
uObject[key.toUpperCase()] = object[key];
|
||||
}
|
||||
return uObject;
|
||||
};
|
||||
|
||||
/** Takes a hash and copies any keys that don't exist from
|
||||
* another hash, by analogy with Object.extend() from
|
||||
* Prototype.js.
|
||||
|
||||
Reference in New Issue
Block a user