Mapbox.js - image with a reduced style from a lower zoom level if the required zoom level is missing

I serve png png files from disk, and I have png fragments for the entire city at zoom level 15. I also have tiles in zoom levels 16-18, but only for certain areas.

I would like to adjust the tile layer so that when the user reaches zoom level 18, the map will display scaled fragments from level 15 as a backup.

I tried to set the parameter maxNativeZoombut did not work for me.

Here is my code:

offlineLayer = L.mapbox.tileLayer(tileJSON, {
    minZoom: 8,
    maxZoom: 18,
    maxNativeZoom: 15
});
map.addLayer(offlineLayer, 'Offline', 1);

Can I make it work using some parameters or do I need to hack it somehow? Or is there some kind of code sample for this?

+4
2

, , , , , - 15- , 16-18 , ? maxNativeZoom. TileLayer "src" URL, . , "maxNativeZoom", URL- "maxNativeZoom". , src= "http://a.tile.openstreetmap.org/15/16368/10896.png" 16-18, "maxNativeZoom" 15.

, , .

, TileLayer, HTTP 404 URL-, , URL-, "maxNativeZoom". (.. 15 , 16-18), , TileLayer, .

0

, Leaflet.TileLayer.Fallback , :

( 404) .

-

OP maxZoom Tile Layer, , , , "" ​​ ( , ) , minZoom.

L.tileLayer.fallback(urlTemplate, {
  minZoom: 8,
  maxZoom: 18
});

: .

0

All Articles