From ee0a44c32748531f99808b15693a0cc49ec9a3ce Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 12 Oct 2025 02:09:14 +0200 Subject: [PATCH] Fix:stabilize rotation if two maps are open --- src/UI/Map/MapLibreAdaptor.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/UI/Map/MapLibreAdaptor.ts b/src/UI/Map/MapLibreAdaptor.ts index de6ae2e10..6439f39fd 100644 --- a/src/UI/Map/MapLibreAdaptor.ts +++ b/src/UI/Map/MapLibreAdaptor.ts @@ -265,7 +265,12 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap { }) this.zoom.addCallbackAndRunD((z) => this.setZoom(z)) 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.setAllowMoving(allowMoving) this.pingKeycodeEvent(allowMoving ? "unlocked" : "locked")