Removed modifications to Array.prototype and moved them into OL.Util instead. All tests pass.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1590 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -35,6 +35,31 @@ OpenLayers.Util.extend = function(destination, source) {
|
||||
return destination;
|
||||
};
|
||||
|
||||
|
||||
/** Remove an object from an array. Iterates through the array
|
||||
* to find the item, then removes it.
|
||||
*
|
||||
* @param {Object} item
|
||||
*
|
||||
* @returns A reference to the array
|
||||
* @type Array
|
||||
*/
|
||||
OpenLayers.Util.removeItem = function(array, item) {
|
||||
for(var i=0; i < array.length; i++) {
|
||||
if(array[i] == item) {
|
||||
array.splice(i,1);
|
||||
//break;more than once??
|
||||
}
|
||||
}
|
||||
return array;
|
||||
};
|
||||
|
||||
/**
|
||||
*/
|
||||
OpenLayers.Util.clearArray = function(array) {
|
||||
array.length = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {String} id
|
||||
* @param {OpenLayers.Pixel} px
|
||||
|
||||
Reference in New Issue
Block a user