forked from MapComplete/MapComplete
Fix:stabilize rotation if two maps are open
This commit is contained in:
parent
4c972bb60d
commit
ee0a44c327
1 changed files with 6 additions and 1 deletions
|
@ -265,7 +265,12 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap {
|
||||||
})
|
})
|
||||||
this.zoom.addCallbackAndRunD((z) => this.setZoom(z))
|
this.zoom.addCallbackAndRunD((z) => this.setZoom(z))
|
||||||
this.maxbounds.addCallbackAndRun((bbox) => this.setMaxBounds(bbox))
|
this.maxbounds.addCallbackAndRun((bbox) => this.setMaxBounds(bbox))
|
||||||
this.rotation.addCallbackAndRunD((bearing) => this.setRotation(bearing))
|
/**
|
||||||
|
* We stabilize rotation
|
||||||
|
* IF two maps are open and have a linked rotation, they will send updates back and forth,
|
||||||
|
* causing a stack overflow
|
||||||
|
*/
|
||||||
|
this.rotation.stabilized(550).addCallbackAndRunD((bearing) => this.setRotation(bearing))
|
||||||
this.allowMoving.addCallbackAndRun((allowMoving) => {
|
this.allowMoving.addCallbackAndRun((allowMoving) => {
|
||||||
this.setAllowMoving(allowMoving)
|
this.setAllowMoving(allowMoving)
|
||||||
this.pingKeycodeEvent(allowMoving ? "unlocked" : "locked")
|
this.pingKeycodeEvent(allowMoving ? "unlocked" : "locked")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue