Thanks a lot Jeff!
In fact the code for OSM is in the file main.js, but I don't know how to link it or add it to the template Contact (htt or inc). Meanwhile I switch to the maps of Google.
<%-- Creating map with OSM --%>
async function setMap(canvas, latLng) {
const pos = { lat: parseFloat(latLng[0]), lng: parseFloat(latLng[1]) };
canvas.id = "map";
map = L.map('map').setView([parseFloat(latLng[0]), parseFloat(latLng[1])], ${mapZoom});
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: ${mapZoom},
attribution: '© <a href="https://openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
L.control.scale({
imperial: true,
metric: true
}).addTo(map);
L.marker(pos).addTo(map);
};
Edited by: kruegerfoto on 15 Jan 2025, 13:20
Edited by: kruegerfoto on 15 Jan 2025, 13:22