Refactoring: Load availableMVTVectorLayers dynamically

This commit is contained in:
Pieter Vander Vennet 2025-01-23 12:30:42 +01:00
parent 2b3e3257fd
commit a50c6b531e
14 changed files with 115 additions and 68 deletions

View file

@ -28,11 +28,10 @@ export class WithSelectedElementState extends UserMapFeatureswitchState {
})
this.mapProperties.lastClickLocation.addCallbackD((lastClick) => {
if (lastClick.mode !== "left" || !lastClick.nearestFeature) {
if (lastClick.mode !== "left") {
return
}
const f = lastClick.nearestFeature
this.setSelectedElement(f)
this.setSelectedElement(lastClick.nearestFeature)
})
@ -67,7 +66,7 @@ export class WithSelectedElementState extends UserMapFeatureswitchState {
const current = this.selectedElement.data
if (
current?.properties?.id !== undefined &&
current.properties.id === feature.properties.id
current.properties.id === feature?.properties?.id
) {
console.log("Not setting selected, same id", current, feature)
return // already set