Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

maxNativeZoom on TileLayer #1250

Open
tvblomberg opened this issue Jan 10, 2018 · 2 comments
Open

maxNativeZoom on TileLayer #1250

tvblomberg opened this issue Jan 10, 2018 · 2 comments

Comments

@tvblomberg
Copy link

Hello,

I am currently in the process of upgrading from version 2.1.5 to 3.1.1.
I ran into an issue with the maxNativeZoom option on tile layer.

Basically it looks like it is being ignored and the map keeps zooming displaying white tiles.
My expectation is the tiles should be autoscaled.

This worked find in version 2.1.5. Here are the fiddles:
2.1.5: https://jsfiddle.net/jfwkq0s4/4/
3.1.1: http://jsfiddle.net/dbpfcoqo/6/

Simple code example:
`
L.mapbox.accessToken = 'pk.eyJ1IjoidHZibG9tYmVyZyIsImEiOiJjaXZsZmpsMWwwNXBuMnRudmJqNGQyMjJwIn0.842ovgKydac51tg6b9qKbg';
var map = L.mapbox.map('map', null, { maxZoom: 20})
.setView([40, -74.50], 9);

var layer = new L.mapbox.tileLayer('mapbox.streets', { maxNativeZoom: 17, maxZoom: 20 });

map.addLayer(layer);
`

@tvblomberg
Copy link
Author

See my solution here:
https://stackoverflow.com/questions/48195486/is-there-an-issue-with-maxnativezoom-on-tile-layers-in-mapboxjs/48209306#48209306

Not sure if this is the best approach curious on anyone's thoughts.

@tvblomberg
Copy link
Author

I will make a pull request for this tonight when I have time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant