Search code examples
editopenlayerspolygonopenstreetmappoints

Changing the points of a polygon in OpenLayers


I've built a script where you can enter a polygon with OpenLayers, because Google Maps has became a paid service. The problem I encountered, was that when you add a polygon it is there, you can delete it, but you can't change the positions of the corners just like in Google Maps. I was wondering if this is also possible with OpenLayers.

Thanks in advance.


Solution

  • Take a look at OpenLayers Modify Feature example. There you can see how you use OpenLayers.Control.ModifyFeature to modify shape of polygon or line or change position of point.