From 61377d907bb8fc30d23c69450ddc86a8a25a2439 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Tue, 6 Apr 2021 19:41:41 +0200 Subject: [PATCH] Erase the hash when an element is unselected --- Customizations/JSON/LayerConfig.ts | 1 - InitUiElements.ts | 1 + Logic/Actors/SelectedFeatureHandler.ts | 4 ++++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Customizations/JSON/LayerConfig.ts b/Customizations/JSON/LayerConfig.ts index 71011ce..0d1a160 100644 --- a/Customizations/JSON/LayerConfig.ts +++ b/Customizations/JSON/LayerConfig.ts @@ -369,7 +369,6 @@ export default class LayerConfig { const self = this; const mappedHtml = tags.map(tgs => { function genHtmlFromString(sourcePart: string): UIElement { - console.log("Got source part ", sourcePart) if (sourcePart.indexOf("html:") == 0) { // We use ยง as a replacement for ; const html = sourcePart.substring("html:".length) diff --git a/InitUiElements.ts b/InitUiElements.ts index 80f9d1c..f5e948f 100644 --- a/InitUiElements.ts +++ b/InitUiElements.ts @@ -448,5 +448,6 @@ export class InitUiElements { ); }); + } } \ No newline at end of file diff --git a/Logic/Actors/SelectedFeatureHandler.ts b/Logic/Actors/SelectedFeatureHandler.ts index 968a3d1..5f5bf5f 100644 --- a/Logic/Actors/SelectedFeatureHandler.ts +++ b/Logic/Actors/SelectedFeatureHandler.ts @@ -27,6 +27,10 @@ export default class SelectedFeatureHandler { featureSource.features.addCallback(_ => self.selectFeature()); selectedFeature.addCallback(feature => { + if(feature === undefined){ + hash.setData("") + } + const h = feature?.properties?.id; if(h !== undefined){ hash.setData(h)