Fix popup which doesn't show up in the case of duplicate elements on the map

This commit is contained in:
Pieter Vander Vennet 2021-10-13 17:18:14 +02:00
parent 54edcf793b
commit ab05979b81
2 changed files with 19 additions and 4 deletions

View file

@ -502,7 +502,18 @@ There are also some technicalities in your theme to keep in mind:
const text = args[2]
const autoapply = args[3]?.toLowerCase() === "true"
const overwrite = args[4]?.toLowerCase() === "true"
const featureIds : UIEventSource<string[]> = tagsSource.map(tags => JSON.parse(tags[featureIdsKey]))
const featureIds : UIEventSource<string[]> = tagsSource.map(tags => {
const ids = tags[featureIdsKey]
try{
if(ids === undefined){
return []
}
return JSON.parse(ids);
}catch(e){
console.warn("Could not parse ", ids, "as JSON to extract IDS which should be shown on the map.")
return []
}
})
return new MultiApply(
{
featureIds,