[OpenLayers-Users] When drawing a point, how to clear the previous point?

gingerbbm stuart.jones at jacobs.com
Wed Jan 14 05:36:53 EST 2009


Dear all

I'm sure this is simple but I'm not getting anywhere.

I have a custom toolbar containing buttons such as "draw point", "draw
line", "draw poly", etc.
If the user selects "draw point" and clicks on the map, a point appears.
What I need is for the next click on the map to clear the previous point,
and draw a new one at the new location.

How do I clear the previous point?

I have investigated destroyFeatures() and if I tie that to the
activate/deactivate function that I've written which is called as the user
chooses a different button, that works fine. But is it possible to call this
prior to each draw action if the current tool isn't deactivated?

Hope this makes sense and that someone can point me in the right direction.

Many thanks
Stuart
-- 
View this message in context: http://n2.nabble.com/When-drawing-a-point%2C-how-to-clear-the-previous-point--tp2156139p2156139.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list