[OpenLayers-Users] the right way to refresh a text layer?

Michal Rok mrok at mrok.com
Sun Dec 2 13:41:06 EST 2007


Hi,

Somewhere in my code I have a function that is supposed to destroy and re-create a Text layer to display up-to-date information:

function refresh_markers() {
 map.removeLayer(markers);
 markers.destroy();
 markers = new OpenLayers.Layer.Text( "Test layer", {location: "maps/aircraft.csv?" +
    new Date().getTime() } );
 map.addLayer(markers);
}

This appears to leak memory - every time the layer is refreshed, by Explorer memory consumption grows by 5MB.

What is the right way to refresh a text layer?


regards,

Michal Rok
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20071202/739f2f37/attachment.html


More information about the Users mailing list