I am using @mapbox/mapbox-gl-draw
to draw polygons on a map and would like to show context popup when user selects a polygon.
I think the only feasible event I can use is draw.selectionchange
which is a custom event therefore no mouse cursor position available, but I need the position so as to show the popup.
I created a simple app to demo this. The draw.selectionchange
event is printed in the log after you draw or select a polygon. A map reference is provided in the event payload but I also don't find a way to get cursor position via map.
Any advice is appreciated.