gi-nx / getMapCamera
ts
function getMapCamera(): MapCameraView;Where the map is looking, in the terms an app already thinks in: a ground point, a scale in metres per pixel, and two angles. No mapbox zoom, so an app never converts between zoom levels and ground distances.
Exempt from call throttling, so it is safe to read every frame. To have the same view pushed to the app on every map move instead of asking for it, turn on enableMapCamera and read the mapCamera state key.
Returns
See
enableMapCamera to subscribe rather than poll.
Example
typescript
const view = await rpc.invoke('getMapCamera', []);