Fix: don't crash if an initial hash is given from a non-matching layer

This commit is contained in:
Pieter Vander Vennet 2025-01-08 17:52:03 +01:00
parent a2782348a7
commit 551235a185

View file

@ -88,7 +88,9 @@ export default class InitialMapPositioning {
return
}
const targetLayer = layoutToUse.getMatchingLayer(osmObject.tags)
this.zoom.setData(Math.max(this.zoom.data, targetLayer.minzoom))
if(targetLayer){
this.zoom.setData(Math.max(this.zoom.data, targetLayer.minzoom))
}
const [lat, lon] = osmObject.centerpoint()
this.location.setData({ lon, lat })
})