mapbox-gl-draw icon indicating copy to clipboard operation
mapbox-gl-draw copied to clipboard

Tracking changes in draw.update

Open cristianodri opened this issue 3 years ago • 2 comments

Hello,

I'm using draw.update event and I want to know which parts of a feature have been changed when the action is change_coordinates. The feature collection contains the feature as is after the change, but I don't know which coordinates/vertex have changed. Is there a way to get the changed values?

cristianodri avatar Mar 10 '21 16:03 cristianodri

I'm no expert but I think you could to use turf.

You should keep your copy of old data and then use the event data to compare them both.

intermx-vignesh avatar Nov 18 '21 12:11 intermx-vignesh

Suggestion: draw.update must have both parameters, previousFeatures and currentFeatures.

joel-daros avatar Nov 28 '22 19:11 joel-daros