Public
Edited
Apr 1, 2024
8 forks
4 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
incorporated_place_data = {
const json = await fetch(`https://tigerweb.geo.census.gov/arcgis/rest/services/TIGERweb/tigerWMS_Current/MapServer/28/query?where=GEOID="2148003"&geometryType=esriGeometryPolygon&inSR=4326&outFields=*&returnGeometry=true&f=geojson`).then(d => d.json())

return json
}
Insert cell
census_designated_place_data = {
const json = await fetch(`https://tigerweb.geo.census.gov/arcgis/rest/services/TIGERweb/tigerWMS_Current/MapServer/30/query?where=GEOID="2148003"&geometryType=esriGeometryPolygon&inSR=4326&outFields=*&returnGeometry=true&f=geojson`).then(d => d.json())

return json
}
Insert cell
{
const container = yield htl.html`<div style="height: 500px;">`;
const map = L.map(container);
const countyLayer = L.geoJSON(county_data).addTo(map);
const incorporatedPlaceLayer = L.geoJSON(incorporated_place_data).addTo(map);
const designatedPlaceLayer = L.geoJSON(census_designated_place_data).addTo(map)
map.fitBounds(incorporatedPlaceLayer.getBounds(), {maxZoom: 16});
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution: "© <a href=https://www.openstreetmap.org/copyright>OpenStreetMap</a> contributors"
}).addTo(map);
}
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