Measure Distance on MapLibre

Hello,
I would like to measure the distance between two points selected by the user’s mouse on a map made with go.ScatterMap (MapLibre).

This example Drawing shapes with a Mouse on Cartesian Plots combined with the relayoutData event could work but unfortunately it doesn’t return the latitude and longitude. The clickData event does return lat and lon but only for plotted data it doesn’t work for random positions on the map.

MapLibre provides an example on how to implement this, so I thought about adding a javascript to the dash app. However, I’m unable to locate the maplibregl.Map object required to get this working.

Any suggestions ?

Hey @nhtjs could you add a minimal reproducible example?

By the looks of the demo i could imagine using annotations.