I am trying to draw a freeform polygon in openlayers using the following code:
drawPolygon = new OpenLayers.Control.DrawFeature(layer, OpenLayers.Handler.Polygon, {eventListeners:{"featureadded": newPolygonAdded}});
However, I am having a problem where the polygon won't 'finish' drawing. To clarify, I mean that usually when you double click a vertex, the polygon finishes drawing. With this code however, double clicking has no effect. Please let me know if I am missing some crucial line that tells the handler we are 'done' drawing the polygon! (I haven't seemed to find any suc开发者_StackOverflow社区h line in examples, and the code was working fine before when I was simply trying to draw a regular polygon instead of freeform). Thank you!
I had a similar problem, not sure if its the same cause though... My problem was that I couldn't end the path on my measure(line, polygon) tool when one of the default draw features was active at the same time. I had to change the default controls back to pan to end my measure tool path.
Don't know if its the same problem though...
精彩评论