Published
Edited
Dec 2, 2019
Insert cell
md`# Leaflet`
Insert cell
L = require('leaflet@1.2.0')
Insert cell
html`<link href='${resolve('leaflet@1.2.0/dist/leaflet.css')}' rel='stylesheet' />`
Insert cell
map = {

let container = DOM.element('div', { style: `width:${width}px;height:${width/1.6}px` });

yield container;

let map = L.map(container).setView([38.85682, 115.515404], 13);
let osmLayer = L.tileLayer('https://{s}.tile.thunderforest.com/spinal-map/{z}/{x}/{y}.png?apikey=d1921d56558744ed821907b2b1e1d642', {
attribution: 'Wikimedia maps beta | &copy; <a href="http://osm.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