fix for #787 - put clearArray() in its place ((marked as deprecated, throwing a console warning during use, all usage replaced in code))
git-svn-id: http://svn.openlayers.org/trunk/openlayers@3636 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -385,10 +385,10 @@ OpenLayers.Layer.WFS.prototype =
|
|||||||
if (this.tile) {
|
if (this.tile) {
|
||||||
if (this.vectorMode) {
|
if (this.vectorMode) {
|
||||||
this.renderer.clear();
|
this.renderer.clear();
|
||||||
OpenLayers.Util.clearArray(this.features);
|
this.features.length = 0;
|
||||||
} else {
|
} else {
|
||||||
this.clearMarkers();
|
this.clearMarkers();
|
||||||
OpenLayers.Util.clearArray(this.markers);
|
this.markers.length = 0;
|
||||||
}
|
}
|
||||||
this.tile.draw();
|
this.tile.draw();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,8 +71,16 @@ OpenLayers.Util.removeItem = function(array, item) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function: clearArray
|
* Function: clearArray
|
||||||
*/
|
* *Deprecated*. This function will disappear in 3.0.
|
||||||
|
* Please use "array.length = 0" instead.
|
||||||
|
*
|
||||||
|
* Parameters:
|
||||||
|
* array - {Array}
|
||||||
|
*/
|
||||||
OpenLayers.Util.clearArray = function(array) {
|
OpenLayers.Util.clearArray = function(array) {
|
||||||
|
var msg = "OpenLayers.Util.clearArray() is Deprecated." +
|
||||||
|
" Please use 'array.length = 0' instead.";
|
||||||
|
OpenLayers.Console.warn(msg);
|
||||||
array.length = 0;
|
array.length = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -30,16 +30,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function test_03_Util_Array(t) {
|
function test_03_Util_Array(t) {
|
||||||
t.plan( 2 );
|
t.plan( 1 );
|
||||||
|
|
||||||
var array = new Array(1,2,3,4,5);
|
var array = new Array(1,2,3,4,5);
|
||||||
|
|
||||||
OpenLayers.Util.removeItem(array, 3);
|
OpenLayers.Util.removeItem(array, 3);
|
||||||
t.eq( array.toString(), "1,2,4,5", "Util.removeItem works");
|
t.eq( array.toString(), "1,2,4,5", "Util.removeItem works");
|
||||||
|
|
||||||
OpenLayers.Util.clearArray(array);
|
|
||||||
t.eq( array.toString(), "", "Util.clearArray works");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_04_Util_createDiv(t) {
|
function test_04_Util_createDiv(t) {
|
||||||
|
|||||||
Reference in New Issue
Block a user