In OpenLayers 2, clicking a geometry with an active modify control running, created a drag vertice on every edge of the geometry which could be used to modify the geometry by dragging.

In OpenLayers 3+ with the modify interaction, things are different. Clicking a geometry instantly activates one vertice only that can be dragged.

Can I obtain the ol2 behaviour in ol3+ as well?

1 Answer 1


It can be imitated. You woould need to use a custom style to style the vertices and midpoints similar to https://openlayers.org/en/v4.6.5/examples/polygon-styles.html then use a custom condition function which checks proximity to those points.

The OpenLayers 2 example http://dev.openlayers.org/examples/modify-feature.html

The standard OpenLayers 4 example https://openlayers.org/en/v4.6.5/examples/snap.html

A custom version of the OpenLayers 4 example https://codepen.io/mike-000/pen/NWKvLdG

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.