Can anyone answer this question ? Example I have a map with an initial zoom level set to 7. Users can zoom in and out as much as they want. If I now add minzoom and maxzoom (say 5 and 9) to the map, will the map load faster ? In other words does the map initially load up with tiles on just the zoom level specified, or with other tiles too ? asked 18 May '18, 11:09 trevoh |
A Leaflet map won't load faster for any given zoom level (say 7) if you restrict minzoom and maxzoom to say 5 and 9. The only initial tiles loaded by default are for the initial zoom level. (one caveat is that there are 1000s of Leaflet plugins out there and it's possible that there's one that loads other zoom levels, but by default you'll only request other zoom levels when you actually change the zoom level on the client). answered 18 May '18, 11:33 SomeoneElse ♦ Thanks. All is clear. Just one point of puzzlement. Is there then anything to be gained from adding maxzoom and minzoom apart from reducing load on the map server ?
(18 May '18, 11:42)
trevoh
It really depends on the type of map that you're trying to create. Often a particular tile source will only support certain zoom levels, or it might be you want to create a map that always shows something in context, and so allowing someone to zoom out to show the entire world isn't something that you want to allow. As an example, if you're using OSM's "standard" tile layer that contains tiles at zoom levels up to 19. The Humanitarian layer can render tiles up to zoom 20, so you may want to set maxzoom differently if you were using those tiles).
(18 May '18, 13:23)
SomeoneElse ♦
nice and precise answer
(18 May '18, 15:52)
AntaC
Yes I agree !
(18 May '18, 16:05)
trevoh
|
Can you explain a bit more about what you're actually doing here? Is this an application or a javascript library, and which one? What tiles are you trying to load and from where (and indeed are your trying to load raster tiles or vector ones)?
I'm using Leaflet. Are the tiles raster or vector? Raster, I think, but not sure on this.
Thanks - by default with Leaflet you'll be using raster tiles.