How can I get Camera Altitude in MapBox GL JS?

Viewed 11

I know that using

const camera = map.getFreeCameraOptions();

const cameraPosition = camera._position.toLngLat();

I can get at cameraPosition the longitude and latitude from the camera, but what about the elevation/altitude? What exactly is then, following the previous code:

const elevation = camera._elevation;

And why is always with the value undefined?

How can I get the correct altitude value?

Thanks in advance,

Joan.

0 Answers
Related