mapbox / mapbox.js

Mapbox JavaScript API, a Leaflet Plugin
mapbox.com/mapbox.js/
Other
1.92k stars 385 forks source link

maxNativeZoom ignored if maxzoom set in tileJson #978

Open geografa opened 9 years ago

geografa commented 9 years ago

The maxNativeZoom option for overzooming is ignored if a maxzoom is set on a MBtile source. Code below is adapted from the example: https://www.mapbox.com/mapbox.js/example/v1.0.0/overzoom/

// The native maximum zoom level for this tile layer is 10
var map = L.mapbox.map('map', 'logos-barry.dev_testRasterSource', {
    tileLayer: {
        maxNativeZoom: 10 // The map will use zoom level 10 tiles for all zoom levels past 10
    }
}).setView([37.6, 35.9], 9);

/cc @jfirebaugh

drewbo commented 9 years ago

@geografa Possibly related to a similar leaflet bug which is fixed in latest master but not 0.7.3. Could either overwrite the private _getTileSize function in tile_layer.js or wait for the next release. Relevant commit