[OpenLayers-Users] Re moved markers still occupy memory :/

Christopher Schmidt crschmidt at metacarta.com
Fri Aug 8 10:32:15 EDT 2008


On Fri, Aug 08, 2008 at 02:36:19AM -0700, realjax wrote:
> 
> Try destroying them as well on the markers layer
> 
> If you just want to get rid of all markers on the marker layer it should be:
> 
> localizationLayer.destroy()
> 
> (assuming localizationLayer is of type  OpenLayers.Layer.markers )
> 
> The problem might be in the fact that the removeMarker makes use of
> OpenLayers.Util.RemoveItem, which in turn removes elements from an array
> using the array.splice method. And IE 6 doesn't support this..

Er, I think this is a very unlikely statement... removeItem is used
extensively throughout the code, and if it didn't work in IE6, we'd have
a lot of trouble. 

I've just confirmed via Firebug Lite in IE that
OpenLayers.Util.removeItem(['1','2','3'], '2')

returns:

['1', '3']

So, I don't think looking at OpenLayers.Util.removeItem askance is
likely to work well.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list