Closed jopfre closed 5 years ago
The issue is actually to do with proj4leaflet, so I will close.
For those curious this post explains a bit https://github.com/kartena/Proj4Leaflet/issues/144#issuecomment-343730644
Essentially leaflet's default projection uses a scale factor rather than resolutions like proj4leaflet so can scale to arbitrary zoom levels.
In proj4leaflet each zoom level (resolution) must be defined first. So the solution in this case was to define an "imaginary" resolution in new L.Proj.CRS()
and then set the minNativeZoom
to a "real"resolution in L.OSOpenSpace.TileLayer
options
.
When minNativeZoom: 0 and a negative minZoom value are set on the tile layer, zooming out results in Uncaught Error: Attempted to load an infinite number of tiles
To reproduce set options as follows in OSOpenSpace.js:
Here are two minimal tests to show the issue. os-leaflet https://5amc.cf/test/os.html
open street maps with the same options passed scales the zoom level 0 tiles as expected. https://5amc.cf/test/l.html
Any ideas what might be the cause? I'm happy to investigate but would appreciate pointers if you have any.