26

When I zoom in far enough on my map, the TileLayer disappears and I see a bunch of tiles that say "Map data not yet available". I believe these tiles may be coming from the provider, but I am not sure (I am using ESRI WorldImagery dataset).

Is there any way to, at a certain zoom level, just force the tiles to stretch, instead of requesting the tiles for that zoom level? I am ok with some blur, but I do need to zoom in further.

I tried playing around with the zoomOffset option, but whenever I put something there other than 0, my tiles just never load (all grey).

Thanks!

elsurudo
  • 3,579
  • 2
  • 31
  • 48
  • I'm looking for the exact same thing. They _are_ being served by ESRI. (see http://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer/tile/17/59010/68784). Unlike open street map, for example, which throws a 404 and will cause its TileLayer to file a `tileerror` event. I've been fighting with this all day, have you found anything since posting? – cscott530 Apr 16 '14 at 18:24
  • Unfortunately not. I took the coward's way out and used the (less pretty) Open MapQuest tile set instead... – elsurudo Apr 17 '14 at 18:45
  • I'm looking for the same thing to support zooming past the highest zoom level provided by MapBox Satellite, and just show the same tile, but stretched to the higher zoom level. This is a major difference I see between MapBox and Google currently. Google doesn't necessarily have higher resolution, but it's more usable at the higher zoom levels despite it being 'over-zoomed' I was hoping to find a Leaflet plugin that would do this, but haven't found anything. – JasonRDalton Jul 11 '14 at 19:44

1 Answers1

34

This can be solved by using two of the options of L.TileLayer.

First, set maxNativeZoom to the highest zoom level your tiles provide (the last zoom level before the "Map data not available" starts to appear - this tells Leaflet to stop requesting new tiles when zooming in beyond this level; stretched tiles will be used instead.

Second, set maxZoom to whatever zoom is appropriate; you might not want this to be more than a couple of levels higher than maxNativeZoom, since the stretched tiles will start to look pretty horrible.

You can find out more about the details by checking under "Options" in the documentation for L.TileLayer: http://leafletjs.com/reference.html#tilelayer

Liedman
  • 10,099
  • 4
  • 34
  • 36