Stabilize popups in ShowDataLayer

This commit is contained in:
Pieter Vander Vennet 2021-10-01 05:24:10 +02:00
parent 087d5cdbef
commit bedc576313
3 changed files with 30 additions and 21 deletions

View file

@ -34,9 +34,19 @@ export default class SelectedFeatureHandler {
}else{
// we search the element to select
const feature = state.allElements.ContainingFeatures.get(h)
if(feature !== undefined){
state.selectedElement.setData(feature)
if(feature === undefined){
return;
}
const currentlySeleced = state.selectedElement.data
if(currentlySeleced === undefined){
state.selectedElement.setData(feature)
return;
}
if(currentlySeleced.properties?.id === feature.properties.id){
// We already have the right feature
return;
}
state.selectedElement.setData(feature)
}
}