forked from MapComplete/MapComplete
Fix: fix #1917
This commit is contained in:
parent
d37c1a0b18
commit
903a11d4e7
3 changed files with 20 additions and 5 deletions
|
@ -228,6 +228,10 @@ export default class MetaTagging {
|
||||||
})
|
})
|
||||||
return feats
|
return feats
|
||||||
}
|
}
|
||||||
|
if(!state.perLayer.get(layerId)){
|
||||||
|
// This layer is not loaded
|
||||||
|
return []
|
||||||
|
}
|
||||||
return [state.perLayer.get(layerId).GetFeaturesWithin(bbox)]
|
return [state.perLayer.get(layerId).GetFeaturesWithin(bbox)]
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -475,7 +475,13 @@ class AddDependencyLayersToTheme extends DesugaringStep<LayoutConfigJson> {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
layers.unshift(...dependencies.map((l) => l.config))
|
/**
|
||||||
|
* Must be added to the _end_ of the layer list:
|
||||||
|
* - Imagine that 'walls_and_buildings' is added...
|
||||||
|
* - but there is a layer about a specific type of building already
|
||||||
|
* Adding it up front would cause 'walls_and_buildings' to be triggered
|
||||||
|
*/
|
||||||
|
layers.push(...dependencies.map((l) => l.config))
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...theme,
|
...theme,
|
||||||
|
|
13
src/Utils.ts
13
src/Utils.ts
|
@ -331,11 +331,16 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
||||||
configurable: true,
|
configurable: true,
|
||||||
get: () => {
|
get: () => {
|
||||||
delete object[name]
|
delete object[name]
|
||||||
object[name] = init()
|
try{
|
||||||
if (whenDone) {
|
object[name] = init()
|
||||||
whenDone()
|
if (whenDone) {
|
||||||
|
whenDone()
|
||||||
|
}
|
||||||
|
return object[name]
|
||||||
|
}catch (e) {
|
||||||
|
console.error("Error while calculating a lazy property", e)
|
||||||
|
return undefined
|
||||||
}
|
}
|
||||||
return object[name]
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue