map = {
const mapContainer = DOM.element('div', {style: `width:${width}px;height:${width/1.6}px`});
yield mapContainer;
const map = createMap(mapContainer);
let dataPoints = homicides.map(h => [h.Latitude, h.Longitude, 0.1]);
let markers = markerCluster({});
let markersLayer = L.geoJson(createGeoData(homicides), {
onEachFeature: function (feature, layer) {
const data = feature.properties;
const html = `<div class="popup"><h3>${data.block}</h3>` +
`<p>(${data.location.toLowerCase()})<br />${data.info}<br />${data.date}</p></div>`;
layer.bindPopup(html);
layer.bindTooltip(html, {sticky: true});
}
});
markers.addLayer(markersLayer);
map.addLayer(markers);
}