Published
Edited
Dec 22, 2020
Also listed in…
Visualizations
Insert cell
Insert cell
{
const width = 140;
const height = 220;
const container = html`<div id='123' style="height:${height}px; width: ${width}px" />`;
yield container;

const map = new mapboxgl.Map({
container,
center: polygon.center,
zoom: 17,
style: 'mapbox://styles/mapbox/satellite-v9',
preserveDrawingBuffer: true
});

map.on('load', function () {
map.addSource('maine', {
'type': 'geojson',
'data': {
'type': 'Feature',
'geometry': {
'type': 'Polygon',
'coordinates':[polygon.field_polygon]
}
}
});
map.addLayer({
'id': 'maine',
'type': 'fill',
'source': 'maine',
'layout': {},
'paint': {
'fill-color': '#088',
'fill-opacity': 0.6
}
});
map.fitBounds([
maxRightTop(polygon.field_polygon),
minLeftBottom(polygon.field_polygon)
],{padding: 10})
});

}
Insert cell
Insert cell
Insert cell
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