whai is correct way to remove vector features from vector layer?

tuckerjaguar

New Member
I'm using gwt-openlayers library in my project. I'm using VectorFeature and Vector classes to display moving objects on the map. To refresh positions of moving objects I'm doing the following:1) myVectorLayer.destroyFeatures(); // remove all objects, clear current state2) myVectorLayer.addFeature(vf); // do it for all objectsNow task manager shows that my application uses more and more memory - it looks like there is memory leak in my app and I suspect destroyFeatures() doesn't actually remove vectorFeature object from memory. I have one more suggestion - I'm redrawing objects frequently, once in 5 seconds, may be destroyFeatures method works properly but garbage collection process too slow?
 
Back
Top