forked from MapComplete/MapComplete
		
	Fix: don't crash if an initial hash is given from a non-matching layer
This commit is contained in:
		
							parent
							
								
									a2782348a7
								
							
						
					
					
						commit
						551235a185
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
					@ -88,7 +88,9 @@ export default class InitialMapPositioning {
 | 
				
			||||||
                    return
 | 
					                    return
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                const targetLayer = layoutToUse.getMatchingLayer(osmObject.tags)
 | 
					                const targetLayer = layoutToUse.getMatchingLayer(osmObject.tags)
 | 
				
			||||||
 | 
					                if(targetLayer){
 | 
				
			||||||
                    this.zoom.setData(Math.max(this.zoom.data, targetLayer.minzoom))
 | 
					                    this.zoom.setData(Math.max(this.zoom.data, targetLayer.minzoom))
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
                const [lat, lon] = osmObject.centerpoint()
 | 
					                const [lat, lon] = osmObject.centerpoint()
 | 
				
			||||||
                this.location.setData({ lon, lat })
 | 
					                this.location.setData({ lon, lat })
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue