From 489c6fc3c0935b5e6318599adc0ba4b9fa81794b Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Wed, 6 Jan 2021 13:18:33 +0100 Subject: [PATCH] Fix self-closing popup --- UI/ShowDataLayer.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/UI/ShowDataLayer.ts b/UI/ShowDataLayer.ts index 9968d76..b700f37 100644 --- a/UI/ShowDataLayer.ts +++ b/UI/ShowDataLayer.ts @@ -69,6 +69,10 @@ export default class ShowDataLayer { } }); Hash.hash.addCallback(id => { + // This is a bit of an edge case: if the hash becomes an id to search, we have to show the corresponding popup + if(State.state.selectedElement !== undefined){ + return; // Something is already selected, we don't have to apply this fix + } const action = self._onSelectedTrigger[id]; if(action){ action(); @@ -144,6 +148,7 @@ export default class ShowDataLayer { } leafletLayer.openPopup(); uiElement.Activate(); + State.state.selectedElement.setData(feature); } this._onSelectedTrigger[feature.properties.id.replace("/","_")] = this._onSelectedTrigger[id];