centappe/js/index.js
2023-09-06 17:03:51 +02:00

21 lines
503 B
JavaScript

document.addEventListener('DOMContentLoaded', async () => {
const map = L.map('map').setView([27.49, -9.3], 3);
map.crs = L.CRS.EPSG4326;
const geoJSON = await fetch('/world.geojson').then(res => res.json());
L.geoJson(geoJSON,{
style: function () {
return {
color: '#fff',
opacity: 0.4,
weight: 2,
fillColor: '#19365e',
fillOpacity: 1
};
}
}).addTo(map);
})