World = {
const container = yield html`<div style="height:800px;">`;
const map = (container.value = new maplibregl.Map({
boxZoom: true,
pitch: 0,
bearing: 0,
maplibreLogo: true,
container,
center: [-70.2568, 43.64],
zoom: 12,
style: 'https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json',
scrollZoom: true
}));
map.on('load', function() {
map.loadImage('https://i.imgur.com/VzRWfNk.png',
function(error,image){
if (error) throw error;
map.addImage('schoolIcon', image)});
map.addSource('quake_points', {
type: 'geojson',
data: data
});
map.addLayer({
id: 'earthquakes',
type: 'symbol',
source: 'quake_points',
'layout': {
'icon-image': 'schoolIcon',
'icon-size': 1
}
});
});
map.on('mouseenter', 'earthquakes', function (e) {
popup.setLngLat(e.lngLat).setHTML('<h3>' + e.features[0].properties.place + '</h3>').addTo(map);
});
map.on('mouseleave', 'earthquakes', function (e) {
popup.remove();
});
}