Interaction with mapbox directly (on_click, disable right click)

Hi!

Currently building an interactive scatter plot using scattermapbox and dash.

However, I’d like for users to be able to click and add a point directly to the map (ie, get lat/lon from a click), as well as disable the right click to rotate feature in mapbox. I can’t for the life of me figure out how to interact with mapbox directly, as dash only has click events for the points on the map, and not the map itself. Any workarounds?

I tried loading mapbox GL JS scripts as JavaScript (in assets) as well as html, and while I got a demo working when I load the page with app.index_string = … I’m not sure how to pass that to dash.

Any help is appreciated!

You might be able to do what you want with dash-leaflet :slight_smile:

http://dash-leaflet.herokuapp.com/