Browse Source

fix: mapHelper 用 Mapbox pitch API 替代不存在的 dragPitch

main
xiaosi 3 weeks ago
parent
commit
cdb79efec6
  1. 6
      src/core/mapHelper.js

6
src/core/mapHelper.js

@ -22,14 +22,16 @@ class MapHelper {
this._map.easeTo({ pitch: 45, bearing: 0, duration: 0 }) this._map.easeTo({ pitch: 45, bearing: 0, duration: 0 })
this._map.dragRotate.enable() this._map.dragRotate.enable()
this._map.touchZoomRotate.enableRotation() this._map.touchZoomRotate.enableRotation()
if (this._map.dragPitch) this._map.dragPitch.enable()
this._map.dragRotate.enablePitch?.()
this._map.touchPitch?.enable?.()
} }
if (is2D) { if (is2D) {
this._map.easeTo({ pitch: 0, bearing: 0, duration: 0 }) this._map.easeTo({ pitch: 0, bearing: 0, duration: 0 })
this._map.dragRotate.disable() this._map.dragRotate.disable()
this._map.touchZoomRotate.disableRotation() this._map.touchZoomRotate.disableRotation()
if (this._map.dragPitch) this._map.dragPitch.disable()
this._map.dragRotate.disablePitch?.()
this._map.touchPitch?.disable?.()
} }
} }

Loading…
Cancel
Save