forked from MapComplete/MapComplete
Prevent loops when two features with the same id are shown at the same time
This commit is contained in:
parent
80d4beb38e
commit
634f4e316a
1 changed files with 3 additions and 1 deletions
|
@ -223,7 +223,9 @@ export default class ShowDataLayer {
|
||||||
popup.setContent(`<div style='height: 65vh' id='${id}'>Rendering</div>`)
|
popup.setContent(`<div style='height: 65vh' id='${id}'>Rendering</div>`)
|
||||||
|
|
||||||
leafletLayer.on("popupopen", () => {
|
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) {
|
if (infobox === undefined) {
|
||||||
const tags = State.state.allElements.getEventSourceById(feature.properties.id);
|
const tags = State.state.allElements.getEventSourceById(feature.properties.id);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue