I am using mapbox gl js, which has an intended behaviour of ‘dimming’ a marker if a direct view is obstructed by 3D terrain. I would like to know if there is a calculation I can make to position the camera so that the marker is always directly visible. There are pitch
and bearing
options with the flyTo
command so technically possible if the correct values can be somehow calculated.
I did spend some time trying to insert a snippet with a demo but can’t load the 3D layer for some reason.
This is with the marker obscured;
This is with a direct view:
Ideally, I would like to know how to pan the camera around the coordinate so there is a clear line of sight to the marker, if that is indeed possible.