Skip to content

Commit 3f09fab

Browse files
committed
fix mapbox tiles, again
1 parent 7c5670e commit 3f09fab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/getting-started.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,9 @@ This is a GeoJSON `Feature` object of a `Polygon` geometry representing the grid
401401
</figure>
402402

403403
```js
404+
const ACCESS_TOKEN = "pk.eyJ1Ijoib2JzZXJ2YWJsZWhxLWVuZy1hZG1pbiIsImEiOiJjbHMxaTBwdDkwYnRsMmpxeG12M2kzdWFvIn0.Ga6eIWP2YNQrEW4FzHRcTQ";
404405
const map = L.map(document.querySelector("#map"));
405-
const tile = L.tileLayer("https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/{z}/{x}/{y}?access_token=pk.eyJ1Ijoib2JzZXJ2YWJsZWhxLWVuZy1hZG1pbiIsImEiOiJjbHMxaTBwdDkwYnRsMmpxeG12M2kzdWFvIn0.Ga6eIWP2YNQrEW4FzHRcTQ", {attribution: '© <a href="https://www.mapbox.com/feedback/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>', tileSize: 512, zoomOffset: -1}).addTo(map);
406+
const tile = L.tileLayer(`https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/256/{z}/{x}/{y}@2x?access_token=${ACCESS_TOKEN}`, {attribution: '© <a href="https://www.mapbox.com/feedback/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(map);
406407
const geo = L.geoJSON().addData(forecast).addTo(map);
407408
map.fitBounds(geo.getBounds(), {padding: [50, 50]});
408409
invalidation.then(() => map.remove());

0 commit comments

Comments
 (0)