Skip to content

Commit

Permalink
fix mapbox tiles, again
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Feb 16, 2024
1 parent 7c5670e commit 3f09fab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,9 @@ This is a GeoJSON `Feature` object of a `Polygon` geometry representing the grid
</figure>

```js
const ACCESS_TOKEN = "pk.eyJ1Ijoib2JzZXJ2YWJsZWhxLWVuZy1hZG1pbiIsImEiOiJjbHMxaTBwdDkwYnRsMmpxeG12M2kzdWFvIn0.Ga6eIWP2YNQrEW4FzHRcTQ";
const map = L.map(document.querySelector("#map"));
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);
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);
const geo = L.geoJSON().addData(forecast).addTo(map);
map.fitBounds(geo.getBounds(), {padding: [50, 50]});
invalidation.then(() => map.remove());
Expand Down

0 comments on commit 3f09fab

Please sign in to comment.