Public
Edited
Jan 6
Insert cell
Insert cell
Insert cell
// {
// let mapContainer1 = html`<div style='height:800px;' />`;
// yield mapContainer1;
// let map1 = new mapboxgl.Map({
// container: mapContainer1,
// center: [config.lng, config.lat],
// zoom: config.zoom,
// style: 'mapbox://styles/mapbox/light-v10',
// });
// map1.on('load', () => renderHexes(map1));
// map1.on('zoomend', () => renderHexes(map1));
// map1.on('dragend', () => renderHexes(map1));
// map1.on('resize', () => renderHexes(map1));
// }
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// GPS of Montreal, Quebec, Canada
config = ({
lng: -73.58781,
lat: 45.50884,
zoom: 0
})
Insert cell
getResolutionByZoom = function(zoom){
if (zoom <= 4.0)
return 1;
if (zoom <= 5.1)
return 3;
if (zoom <= 6.6)
return 4;
if (zoom <= 7.8)
return 5;
if (zoom <= 9.0)
return 6;
if (zoom <= 10.1)
return 7;
if (zoom <= 11.5)
return 8;
if (zoom <= 13.5)
return 9;
if (zoom <= 15.5)
return 10;
if (zoom <= 17)
return 11;
if (zoom <= 19)
return 12;
// if (zoom <= 28.1)
// return 13;
return 13;
}
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