![](/img/trans.png)
[英]mapbox gl-js: how to get the styles of points/polygons from mapbox studio and position it programmatically?
[英]How can I get camera position in Mapbox GL JS?
FreeCamera Api 將在 webmercator 坐標中為您提供相機的 position,可以輕松轉換為 lng/lat:
const camera = map.getFreeCameraOptions();
const cameraPosition = camera._position.toLngLat();
我在這里有一個代碼筆來顯示這一點,只要移動 map 並將其顯示為插圖 map 上的圓形標記,就會獲取相機 position:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.