Draft map with Leaflet (inverted logic...)
This commit is contained in:
24
js/map.js
Normal file
24
js/map.js
Normal 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: '© <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;
|
||||
Reference in New Issue
Block a user