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

Disable click callback on polygons

Open xhuang26 opened this issue 5 years ago • 2 comments

After drawing a polygon, wondering if there is a way to disable (and later enable) event listener for polygon click? The reason being that I'm developing a map that has a lot of layers/features and they can overlap with the draw. I hope to disable draw interactions when user is intended to play with other features. Thanks!

xhuang26 avatar Nov 27 '20 02:11 xhuang26

Hi @xhuang26 do you get something regarding this. I was also working in similar problem but my scenario was that when a polygon is drawn we have to disable interactions with polygon so i created a custom mode and when the polygon is drawn on the screen selectionChange event is called and then i am changing my mode to the custom mode which i have created

kartikmalhotra avatar Mar 06 '21 06:03 kartikmalhotra

I've also used a change to "static" mode to get around this issue

tryforceful avatar Mar 11 '22 16:03 tryforceful