[OpenLayers-Trac] [OpenLayers] #3331: Markers memmory leak
OpenLayers
trac-20090302 at openlayers.org
Mon May 30 10:33:26 EDT 2011
#3331: Markers memmory leak
---------------------+------------------------------------------------------
Reporter: urkoman | Owner:
Type: bug | Status: new
Priority: minor | Milestone: 2.12 Release
Component: general | Version: 2.10
Keywords: memmory | State:
---------------------+------------------------------------------------------
After adding markers on map, about 150 markers with different picture
every 3 seconds, memmory rise in IE, Firefox and Chrome in Version 2.10.
In version 2.8 you added MemmoryLeakFixes, which works perfect in Firefox
and Chrome, but version 2.10 with single file don't have this fix and
memmory raise again.
1.) '''removing markers:'''
''[[BR]]
var myMarkers = lLayerMarker.markers;[[BR]]
for (i = 0; i < myMarkers.length; i++) {[[BR]]
lLayerMarker.removeMarker(myMarkers[i]);[[BR]]
}''[[BR]]
2.) '''adding markers'''
''[[BR]]
var size = new OpenLayers.Size(tag.IconSize, tag.IconSize);[[BR]]
var icon = new OpenLayers.Icon(tag.Icon, new OpenLayers.Size(tag.IconSize,
tag.IconSize));[[BR]]
var point = ReturnPointLatLon(tag.Lat, tag.Lon);[[BR]]
var marker = new OpenLayers.Marker(point, icon);[[BR]]
switch (tag.Type)[[BR]]
{
case CONST_PIN_Vehicle:[[BR]]
marker.events.register('mousedown', marker, function(evt) {
VehicleSelectFromMap(tag.Obj, evt); OpenLayers.Event.stop(evt); });[[BR]]
break;[[BR]]
}[[BR]]
marker.tag = tag;[[BR]]
lAddOnLayer.addMarker(marker);''[[BR]]
Many thanks for any information how to solve problems with memmory in
version 2.10, maybe even in IE
Best regards
--
Ticket URL: <http://trac.openlayers.org/ticket/3331>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list