test = {
let container = DOM.element('div', { style: `width:${width}px;height:${width/1.6}px` });
yield container;
let map = L.map(container).setView([35, 10], 2);
L.svg({clickable:true}).addTo(map)
const overlay = d3.select(map.getPanes().overlayPane)
const svg = overlay.select('svg').attr("pointer-events", "auto")
const g = svg.append('g').attr('class', 'leaflet-zoom-hide')
const projectPoint = function(x, y) {
const point = map.latLngToLayerPoint(new L.LatLng(y, x))
this.stream.point(point.x, point.y)
}
const projection = d3.geoTransform({point: projectPoint})
const pathCreator = d3.geoPath().projection(projection)
const areaPaths = g.selectAll('path')
.data(world.features)
.join('path')
.attr('stroke', 'black')
.attr('fill', 'white')
.attr("z-index", 3000)
.attr('stroke-width', 2.5)
let PhilAreasLayer2 = L.geoJson(capital, {
weight: 2,
color: "#432",
}).bindPopup(function (Layer) {
return '<a href="https://globalreportingcentre.org/" target="_blank"><h1> Test Title </h1><img src="https://upload.wikimedia.org/wikipedia/commons/4/4a/100x100_logo.png" width=100 height=100 /></a>';
})
.addTo(map);
const onZoom = () => areaPaths.attr('d', pathCreator)
onZoom()
map.on('zoomend', onZoom)
map.fitBounds(PhilAreasLayer2.getBounds());
}