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',
'© <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
}