forked from MapComplete/MapComplete
Fix: actually apply preferred background layer
This commit is contained in:
parent
f7d19bcc02
commit
b69c2de3f4
1 changed files with 2 additions and 0 deletions
|
@ -48,6 +48,7 @@ export class PreferredRasterLayerSelector {
|
||||||
this._preferredBackgroundLayer.addCallbackD((_) => self.updateLayer())
|
this._preferredBackgroundLayer.addCallbackD((_) => self.updateLayer())
|
||||||
|
|
||||||
this._availableLayers.addCallbackD((_) => self.updateLayer())
|
this._availableLayers.addCallbackD((_) => self.updateLayer())
|
||||||
|
self.updateLayer()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -63,6 +64,7 @@ export class PreferredRasterLayerSelector {
|
||||||
const foundLayer = isCategory
|
const foundLayer = isCategory
|
||||||
? available.find((l) => l.properties.category === targetLayerId)
|
? available.find((l) => l.properties.category === targetLayerId)
|
||||||
: available.find((l) => l.properties.id === targetLayerId)
|
: available.find((l) => l.properties.id === targetLayerId)
|
||||||
|
console.debug("Updating background layer to", foundLayer.id,{targetLayerId, queryParam:this._queryParameter.data, preferred: this._preferredBackgroundLayer.data, isCategory})
|
||||||
if (foundLayer) {
|
if (foundLayer) {
|
||||||
this._rasterLayerSetting.setData(foundLayer)
|
this._rasterLayerSetting.setData(foundLayer)
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in a new issue