24 lines
660 B
JavaScript
24 lines
660 B
JavaScript
// 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: '© <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; |