I have a web application in OpenLayers and I am starting to rewrite it to OpenLayers 3. In the application I have some features that I need to delete/move/add/edit then to save the changes to the server.

In the previous version I added a new control, and an event to the control. These are all the controls in the previous version:

    controls = {
    point: new OpenLayers.Control.DrawFeature(editable,
                        OpenLayers.Handler.Point, { **featureAdded: onCompletAdd** }),
    line: new OpenLayers.Control.DrawFeature(editable,
                        OpenLayers.Handler.Path, { **featureAdded: onCompletAdd** }),
    polygon: new OpenLayers.Control.DrawFeature(editable,
                        OpenLayers.Handler.Polygon, { **featureAdded: onCompletAdd** }),
    regular: new OpenLayers.Control.DrawFeature(editable,
                        { handlerOptions: { sides: 5} }, { featureAdded: onCompletAdd }),
    select: new OpenLayers.Control.SelectFeature(
                    clickout: true, toggle: false,
                    multiple: false, hover: false,
                    box: false,
                    toggleKey: "ctrlKey", // ctrl key removes from selection
                    multipleKey: "shiftKey" // shift key adds to selection

    modify: new OpenLayers.Control.ModifyFeature(editable, { **onModificationEnd: onCompleteMove** }),
    deletef: new OpenLayers.Control.SelectFeature(editable, {
        clickout: false,
        box: false,
        toggle: false,
        title: "Delete"

It's calling the events featureAdded,onModificationEnd etc... and for deleting I register to the event 'featurehighlighted' like this:

    controls.deletef.events.register("featurehighlighted", this, function (e) {

So how can i do it in OpenLayers 3? I didn't find any helpful examples in the API.

1 Answer 1


There're two examples that modify features in the documentation. One is


and the other is


  • 1
    What events can be registered to the modify "interaction"?
    – Rafael
    Commented Oct 14, 2014 at 4:13

Your Answer

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

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