viewof CrimeMap = {
let container = DOM.element('div', { style: `width:${width}px;height:${width/2}px` });
yield container
let map = L.map(container);
let osmLayer = L.tileLayer('https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}@2x.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
let VanAreasLayer = L.geoJson(vanAreas, {
weight: 2,
color: "#432",
}).bindPopup(function (Layer) {
return Layer.feature.properties.NAME;
}).addTo(map);
let crimePoints = vanCrime.features.map(feature =>
feature.geometry.coordinates.slice().reverse().concat([0.5]));
let crimeLayer = heatLayer(crimePoints).addTo(map);
map.fitBounds(VanAreasLayer.getBounds());
}