Prevent loops when two features with the same id are shown at the same time

This commit is contained in:
pietervdvn 2021-10-01 02:57:26 +02:00
parent 80d4beb38e
commit 634f4e316a

View file

@ -223,7 +223,9 @@ export default class ShowDataLayer {
popup.setContent(`<div style='height: 65vh' id='${id}'>Rendering</div>`)
leafletLayer.on("popupopen", () => {
State.state.selectedElement.setData(feature)
if(State.state.selectedElement.data?.properties?.id !== feature.properties.id){
State.state.selectedElement.setData(feature)
}
if (infobox === undefined) {
const tags = State.state.allElements.getEventSourceById(feature.properties.id);