0

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's gravatar image

trevoh
9223
accept rate: 0%

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)?

(18 May '18, 11:18) SomeoneElse ♦

I'm using Leaflet. Are the tiles raster or vector? Raster, I think, but not sure on this.

(18 May '18, 11:28) trevoh

Thanks - by default with Leaflet you'll be using raster tiles.

(18 May '18, 11:30) SomeoneElse ♦

One Answer:
2

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).

permanent link

answered 18 May '18, 11:33

SomeoneElse's gravatar image

SomeoneElse ♦
33.0k65343778
accept rate: 16%

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

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×89
×18
×13
×1

question asked: 18 May '18, 11:09

question was seen: 2,734 times

last updated: 18 May '18, 16:05

powered by OSQA