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

Is there a way to save a drawn line or polygon? I think I've checked most places but can't find a way to do it.

Open walkingthehills opened this issue 3 years ago • 2 comments

walkingthehills avatar Feb 02 '22 15:02 walkingthehills

Calling draw.getAll(); on the handle for the mapbox-gl-draw instance will fetch the geoJSON of all the drawn elements, and you can use/save that geoJSON from there... Is that what you mean?

tryforceful avatar Mar 11 '22 15:03 tryforceful

You can, then, show those features by using the draw.add(); function.

Youllou avatar May 25 '22 09:05 Youllou