forked from MapComplete/MapComplete
		
	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
 | 
					                .layers.find((l) => l.id.startsWith("mapcomplete_"))?.id
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (background.type === "vector") {
 | 
					            if (background.type === "vector") {
 | 
				
			||||||
                if(background.style){
 | 
					                map.setStyle(background.style ?? background.url)
 | 
				
			||||||
                    map.setStyle(background.style)
 | 
					 | 
				
			||||||
                }else{
 | 
					 | 
				
			||||||
                    map.setStyle(AvailableRasterLayers.maptilerDefaultLayer.properties.style)
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
 | 
					 | 
				
			||||||
                map.addLayer(
 | 
					                map.addLayer(
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        id: background.id,
 | 
					                        id: background.id,
 | 
				
			||||||
| 
						 | 
					@ -150,6 +145,7 @@ class SingleBackgroundHandler {
 | 
				
			||||||
                        map.setPaintProperty(background.id, "raster-opacity", o)
 | 
					                        map.setPaintProperty(background.id, "raster-opacity", o)
 | 
				
			||||||
                    }catch (e) {
 | 
					                    }catch (e) {
 | 
				
			||||||
                        console.debug("Could not set raster-opacity of", background.id)
 | 
					                        console.debug("Could not set raster-opacity of", background.id)
 | 
				
			||||||
 | 
					                        return true // This layer probably doesn't exist anymore, so we unregister
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                })
 | 
					                })
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue