{
let container = DOM.element('div', { id: 'map', style: `width:${width}px;height:${width/1.6}px` });
yield container;
let osmLayer = L.tileLayer('https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}@2x.png', {
attribution: 'Wikimedia maps beta | © <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
});
let canvas = L.tileLayer('https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png', {
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> © <a href="http://cartodb.com/attributions">CartoDB</a>',
subdomains: 'abcd',
maxZoom: 19
});
let map = L.map(container, {
layers: [canvas],
center: [50.00, 14.44],
zoom: 7
});
let layerControl = L.control.layers();
layerControl.addTo(map);
layerControl.addBaseLayer(canvas, 'Dark Canvas');
layerControl.addBaseLayer(osmLayer, 'OSM');
let tooltip = new L.Tooltip();
glify.shapes({
map,
data,
click: (e, feature) => {
L.popup()
.setLatLng(e.latlng)
.setContent('You clicked on ' + feature.properties.NAZKR_ENG)
.openOn(map);
console.log(feature);
console.log(e);
},
hover: (e, feature) => {
tooltip
.setLatLng(e.latlng)
.setContent('You are hovering on ' + feature.properties.NAZKR_ENG)
.addTo(map);
}
});
}