when we destroy a markers layer, remove all of its tiles. do not, however, destroy them... because they were not created here.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@541 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -20,6 +20,16 @@ OpenLayers.Layer.Markers.prototype =
|
|||||||
this.markers = new Array();
|
this.markers = new Array();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
destroy: function() {
|
||||||
|
this.clearMarkers();
|
||||||
|
markers = null;
|
||||||
|
OpenLayers.Layer.prototype.destroy.apply(this, arguments);
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {OpenLayers.Bounds} bounds
|
* @param {OpenLayers.Bounds} bounds
|
||||||
* @param {Boolean} zoomChanged
|
* @param {Boolean} zoomChanged
|
||||||
@@ -52,6 +62,17 @@ OpenLayers.Layer.Markers.prototype =
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
clearMarkers: function() {
|
||||||
|
if (this.markers != null) {
|
||||||
|
while(this.markers.length > 0) {
|
||||||
|
this.removeMarker(this.markers[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/** clear all the marker div's from the layer and then redraw all of them.
|
/** clear all the marker div's from the layer and then redraw all of them.
|
||||||
* Use the map to recalculate new placement of markers.
|
* Use the map to recalculate new placement of markers.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user