Skip to content

Commit

Permalink
wip: Ability to rotate the map - added ability to rotate interactivel…
Browse files Browse the repository at this point in the history
…y or with compass tracking (#855)
  • Loading branch information
claustres committed Oct 15, 2024
1 parent 85f45ef commit c2d95be
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions map/client/mixins/map/mixin.base-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,20 @@ export const baseMap = {
}
return this.map.getBearing()
},
setCompassBearingTrackingEnabled (enabled) {
if (enabled) {
if (!this.map.compassBearing.enabled()) this.map.compassBearing.enable()
} else if (this.map.compassBearing.enabled()) {
this.map.compassBearing.disable()
}
},
setTouchRotateEnabled (enabled) {
if (enabled) {
if (!this.map.touchRotate.enabled()) this.map.touchRotate.enable()
} else if (this.map.touchRotate.enabled()) {
this.map.touchRotate.disable()
}
},
getBounds () {
this.viewBounds = this.map.getBounds()
const south = this.viewBounds.getSouth()
Expand Down

0 comments on commit c2d95be

Please sign in to comment.