cesium-mapboxgl-syncamera icon indicating copy to clipboard operation
cesium-mapboxgl-syncamera copied to clipboard

有个问题

Open onsummer opened this issue 3 years ago • 0 comments

Cesium 一旦 lookAt 后,鼠标就不能平移操作了,setView 才能平移。

另附个人的总结,Cesium 的 Heading 是 [0, 360],对应 Mapbox 的 bearing 是 [-180, 180],也即:

if (cesiumHeading < 180) { // 角度
  mapboxBearing = cesiumHeading
} else { // 大于 180
  mapboxBearing = cesiumHeading - 360
}

pitch 比较简单,二者绝对值互余

if (cesiumPitch > -30) {
  mapboxPitch = 60 // Mapbox 2.x 之前最大只到 60 度倾角
} else {
  mapboxPitch = 90 - Math.abs(cesiumPitch)
}

onsummer avatar Dec 23 '21 11:12 onsummer