forked from MapComplete/MapComplete
Refactoring: Load availableMVTVectorLayers dynamically
This commit is contained in:
parent
2b3e3257fd
commit
a50c6b531e
14 changed files with 115 additions and 68 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue