Public
Edited
May 19, 2024
Insert cell
Insert cell
Insert cell
Insert cell
view = input == "Street"
? "mapbox://styles/mapbox/streets-v12"
: input == "Satellite"
? "mapbox://styles/mapbox/satellite-streets-v12"
: "mapbox://styles/mapbox/streets-v12"
Insert cell
height = 600
Insert cell
Insert cell
Insert cell
Insert cell
mapboxgl = {
const gl = await require("mapbox-gl@2.2.0");
// https://www.mapbox.com/help/how-access-tokens-work/
gl.accessToken =
"pk.eyJ1IjoiY3lydXNvYnJpZW4iLCJhIjoiY2x2cGE3bmljMHh4ZDJrcGtubnY3ZGF1byJ9.3uW_NhL-8JNO4164DY2d6Q";
const href = await require.resolve("mapbox-gl@2.2.0/dist/mapbox-gl.css");
document.head.appendChild(html`<link href=${href} rel=stylesheet>`);

return gl;
}
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more