Erase the hash when an element is unselected

This commit is contained in:
pietervdvn 2021-04-06 19:41:41 +02:00
parent 454f30cf3b
commit 61377d907b
3 changed files with 5 additions and 1 deletions

View file

@ -369,7 +369,6 @@ export default class LayerConfig {
const self = this; const self = this;
const mappedHtml = tags.map(tgs => { const mappedHtml = tags.map(tgs => {
function genHtmlFromString(sourcePart: string): UIElement { function genHtmlFromString(sourcePart: string): UIElement {
console.log("Got source part ", sourcePart)
if (sourcePart.indexOf("html:") == 0) { if (sourcePart.indexOf("html:") == 0) {
// We use § as a replacement for ; // We use § as a replacement for ;
const html = sourcePart.substring("html:".length) const html = sourcePart.substring("html:".length)

View file

@ -448,5 +448,6 @@ export class InitUiElements {
); );
}); });
} }
} }

View file

@ -27,6 +27,10 @@ export default class SelectedFeatureHandler {
featureSource.features.addCallback(_ => self.selectFeature()); featureSource.features.addCallback(_ => self.selectFeature());
selectedFeature.addCallback(feature => { selectedFeature.addCallback(feature => {
if(feature === undefined){
hash.setData("")
}
const h = feature?.properties?.id; const h = feature?.properties?.id;
if(h !== undefined){ if(h !== undefined){
hash.setData(h) hash.setData(h)