More fixes to the refactored code

This commit is contained in:
Pieter Vander Vennet 2021-06-15 16:18:58 +02:00
parent 42d13f564c
commit 94f9a0de56
15 changed files with 78 additions and 82 deletions

View file

@ -126,22 +126,23 @@ export default class ShowDataLayer {
closeButton: false
}, leafletLayer);
leafletLayer.bindPopup(popup);
let infobox : FeatureInfoBox = undefined;
leafletLayer.bindPopup(popup);
let infobox: FeatureInfoBox = undefined;
const id = `popup-${feature.properties.id}-${this._cleanCount}`
popup.setContent(`<div style='height: 50vh' id='${id}'>Rendering</div>`)
popup.setContent(`<div style='height: 65vh' id='${id}'>Rendering</div>`)
leafletLayer.on("popupopen", () => {
State.state.selectedElement.setData(feature)
if (infobox === undefined) {
if (infobox === undefined) {
const tags = State.state.allElements.getEventSourceById(feature.properties.id);
infobox = new FeatureInfoBox(tags, layer);
infobox.isShown.addCallback(isShown => {
if (!isShown) {
State.state.selectedElement.setData(undefined);
leafletLayer.closePopup()
}
});
}
@ -162,7 +163,7 @@ export default class ShowDataLayer {
leafletLayer.openPopup()
}
})
}
private CreateGeojsonLayer(): L.Layer {