diff --git a/lib/OpenLayers/Marker.js b/lib/OpenLayers/Marker.js index 8f7db3da6e..54991974f5 100644 --- a/lib/OpenLayers/Marker.js +++ b/lib/OpenLayers/Marker.js @@ -79,6 +79,13 @@ OpenLayers.Marker = OpenLayers.Class({ this.events = new OpenLayers.Events(this, this.icon.imageDiv, null); }, + /** + * APIMethod: destroy + * Destroy the marker. You must first remove the marker from any + * layer which it has been added to, or you will get buggy behavior. + * (This can not be done within the marker since the marker does not + * know which layer it is attached to.) + */ destroy: function() { this.map = null;