Published
Edited
Dec 6, 2018
Insert cell
Insert cell
map = {
const WIDTH = width
const HEIGHT = width * 0.6
let container = DOM.element('div', { style: `width:${WIDTH}px;height:${HEIGHT}px` })
yield container

const tileLayer = new ol.layer.Tile({
source: new ol.source.OSM({
attributions: [
'Wikimedia maps',
'&copy; <a href="http://osm.org/copyright">OpenStreetMap</a>'
],
url: 'https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}@2x.png',
})
})
const view = new ol.View({
center: ol.proj.fromLonLat([7.5886, 47.5596]),
zoom: 13
})
const map = container.value = new ol.Map({
layers: [tileLayer],
target: container,
view,
})
return container
}
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