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

Draw several features

Open userVF opened this issue 10 months ago • 1 comments

Hi All! I need to draw several separate features. Following behavior detected: re-call draw.changeMode('draw_.xxx') after the draw is finished lets to draw another feature and draw.getAll() returns a FeatureCollection with all those features. It is what i need, but looks like undocumented trick. Question: Is there right way to draw such several features?

userVF avatar Feb 21 '25 13:02 userVF

Usually when you want to draw several features you use

draw.set({
    type: "FeatureCollection",
    features: features
})

fatorius avatar Mar 25 '25 02:03 fatorius