Fix vector layers, fix #1652 again
This commit is contained in:
parent
8dd042c4f7
commit
aaad4ac72c
1 changed files with 2 additions and 6 deletions
|
@ -127,13 +127,8 @@ class SingleBackgroundHandler {
|
|||
.layers.find((l) => l.id.startsWith("mapcomplete_"))?.id
|
||||
|
||||
if (background.type === "vector") {
|
||||
if(background.style){
|
||||
map.setStyle(background.style)
|
||||
}else{
|
||||
map.setStyle(AvailableRasterLayers.maptilerDefaultLayer.properties.style)
|
||||
}
|
||||
map.setStyle(background.style ?? background.url)
|
||||
} else {
|
||||
|
||||
map.addLayer(
|
||||
{
|
||||
id: background.id,
|
||||
|
@ -150,6 +145,7 @@ class SingleBackgroundHandler {
|
|||
map.setPaintProperty(background.id, "raster-opacity", o)
|
||||
}catch (e) {
|
||||
console.debug("Could not set raster-opacity of", background.id)
|
||||
return true // This layer probably doesn't exist anymore, so we unregister
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue