Add wikipedia box

This commit is contained in:
Pieter Vander Vennet 2021-10-02 22:31:16 +02:00
parent 1edf829cad
commit 8b4442c8cc
20 changed files with 401 additions and 149 deletions

View file

@ -225,7 +225,6 @@ export default class ShowDataLayer {
popup.setContent(`<div style='height: 65vh' id='${id}'>Popup for ${feature.properties.id} ${feature.geometry.type}</div>`)
leafletLayer.on("popupopen", () => {
console.trace(`Opening the popup for ${feature.properties.id} ${feature.geometry.type}`)
if (infobox === undefined) {
const tags = State.state.allElements.getEventSourceById(feature.properties.id);
infobox = new FeatureInfoBox(tags, layer);
@ -239,7 +238,9 @@ export default class ShowDataLayer {
}
infobox.AttachTo(id)
infobox.Activate();
State.state.selectedElement.setData(feature)
if (State.state?.selectedElement?.data?.properties?.id !== feature.properties.id) {
State.state.selectedElement.setData(feature)
}
});