I am using modify control in OpenLayers 2.12. After feature is modified I am running the function below:

building.events.register('afterfeaturemodified',building, onchanges);

Where building is my WFS layer. Now in "onchanges" function runs and now I want my WFS feature id/name, etc.

My function is as follows:

function onchanges(ev)
            var polygonch=ev.feature.geometry;

Now in this function I want feature id/name on which modification is done. Or other method to get feature info on which editing/modification is done.


You just need to call for the feature id, the same way you would for the feature geometry:

 changed_polygon_id = ev.feature.id;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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