Using Mapbox's flyTo function in plotly.js

I am currently using plotly.js and scattermapbox to create a map.

I’m interested in using Mapbox’s flyTo function: https://docs.mapbox.com/mapbox-gl-js/example/flyto/

Let’s assume my map is the Meteorite Landing Location example: https://plot.ly/javascript/scattermapbox/#multiple-markers

When I add the Event Listener specified in the Mapbox flyTo page, what is the variable name I should replace “map” with?

In other words, when adding the below code,

document.getElementById('fly').addEventListener('click', function () {

// Fly to a random location by offsetting the point -74.50, 40

// by up to 5 degrees.

map.flyTo({

...

What should I replace “map” with?

You try using

var gd = document.getElementById(/* id of your graph */)
gd._fullLayout.mapbox._subplot.map.flyTo( /* */)
three reasons why you should buy plotly pro: support open source, get great support, host your plots and dashboards online