Draft map with Leaflet (inverted logic...)

This commit is contained in:
2025-10-03 18:17:09 +02:00
parent dd18fdce3d
commit 051a32195e
8 changed files with 85 additions and 7 deletions

24
js/map.js Normal file
View File

@@ -0,0 +1,24 @@
// Global Leaflet
const Map = {};
Map.init = function(mapContainerId) {
let baseMap = new L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxNativeZoom : 15,
maxZoom: 15,
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
});
// Mappa centrata su Roma...
let map = L.map(mapContainerId, {
//attributionControl: false,
minZoom: 5,
}).setView([41.9028, 12.4964], 6);
baseMap.addTo(map);
L.marker([45.4363, 12.3352]).addTo(map)
.bindPopup('Teatro San Salvador, Venezia')
.openPopup();
}
export default Map;