mapbox / mapbox.js

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

[docs] incorrect implementation in the leaflet example #1320

Closed riastrad closed 4 years ago

riastrad commented 4 years ago

The Leaflet.js example that is live here: https://docs.mapbox.com/mapbox.js/example/v1.0.0/plain-leaflet/

Does not correctly account for the tileSize of the responses coming from the Static Tiles API. The fix should be quite simple:

var mapboxTiles = L.tileLayer('https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/{z}/{x}/{y}?access_token=' + L.mapbox.accessToken, {
       attribution: '© <a href="https://www.mapbox.com/feedback/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
       tileSize: 512,
       zoomOffset: -1
});