Added description message to marker

This commit is contained in:
2025-01-06 19:56:53 +01:00
parent 488631e1aa
commit 16cf06fb33
+5 -1
View File
@@ -1,4 +1,7 @@
var noDescText = "No description available";
var shOSM = L.tileLayer('https://mbtiler.nyaaa.net/styles/basic-preview/512/{z}/{x}/{y}.png', {
maxZoom: 19,
@@ -45,11 +48,12 @@ fetch('./data.json')
.then(data => {
// Define waypoint markers
function createMarker(waypoint) {
return L.marker([waypoint.lat, waypoint.lng], {
radius: 5,
color: '#337aff',
fillColor: '#337aff'
});
}).bindPopup(waypoint.desc ?? noDescText);
};
// Create waypoints from server data and add them to the map