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:
euzuro
2006-06-07 16:08:15 +00:00
parent 85b14a3c93
commit e06b157090

View File

@@ -20,6 +20,16 @@ OpenLayers.Layer.Markers.prototype =
this.markers = new Array();
},
/**
*
*/
destroy: function() {
this.clearMarkers();
markers = null;
OpenLayers.Layer.prototype.destroy.apply(this, arguments);
},
/**
* @param {OpenLayers.Bounds} bounds
* @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.
* Use the map to recalculate new placement of markers.
*/