"മീഡിയവിക്കി:Common.js" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം
(ചെ.)No edit summary |
(ചെ.)No edit summary |
||
| വരി 3: | വരി 3: | ||
document.addEventListener("DOMContentLoaded", function () { | document.addEventListener("DOMContentLoaded", function () { | ||
// Check if L (Leaflet) is loaded | |||
if (typeof L !== "undefined" && L.Marker) { | |||
// Define a custom icon | |||
const customIcon = L.icon({ | |||
iconUrl: "https://schoolwiki.in/extensions/Kartographer/lib/external/mapbox/images/marker-icon-2x.png", | |||
iconSize: [30, 70], // Size of the icon | |||
iconAnchor: [15, 35] // Point of the icon which will correspond to the marker's location | |||
}); | }); | ||
// Override the default marker icon | |||
L.Marker.prototype.options.icon = customIcon; | |||
} else { | |||
console.error("Leaflet is not loaded. Make sure the map is initialized properly."); | |||
} | } | ||
}); | }); | ||