WesternCanadianCities = {
let container = DOM.element('div', { style: `width:${width}px;height:${width/1.6}px` });
yield container;
let map = L.map(container).setView([53.2527, -123.1207], 5).fitBounds(L.geoJson(Wcities).getBounds());
let osmLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
L.svg({clickable:true}).addTo(map)
const overlay = d3.select(map.getPanes().overlayPane)
const svg = overlay.select('svg').attr("pointer-events", "auto")
const Dots = svg.selectAll('circle')
.attr("class", "Dots")
.data(Wcities.features)
.join('circle')
.attr("id", "dotties")
.attr("fill", "steelblue")
.attr("stroke", "black")
.attr("cx", d => map.latLngToLayerPoint([d.geometry.coordinates[1],d.geometry.coordinates[0]]).x)
.attr("cy", d => map.latLngToLayerPoint([d.geometry.coordinates[1],d.geometry.coordinates[0]]).y)
.attr("r", 5)
.on('mouseover', function() {
d3.select(this).transition()
.duration('150')
.attr("fill", "red")
.attr('r', 10)
})
.on('mouseout', function() {
d3.select(this).transition()
.duration('150')
.attr("fill", "steelblue")
.attr('r', 5)
});
const update = () => Dots
.attr("cx", d => map.latLngToLayerPoint([d.geometry.coordinates[1],d.geometry.coordinates[0]]).x)
.attr("cy", d => map.latLngToLayerPoint([d.geometry.coordinates[1],d.geometry.coordinates[0]]).y)
map.on("zoomend", update)
}