ചെക്ക് യൂസർമാർ, emailconfirmed, സമ്പർക്കമുഖ കാര്യനിർവാഹകർ, kiteuser, oversight, കാര്യനിർവാഹകർ, അപ്ലോഡ് സഹായി മേള തിരുത്തുന്നവർ
783
തിരുത്തലുകൾ
(ചെ.)No edit summary |
(ചെ.)No edit summary |
||
| വരി 2: | വരി 2: | ||
document.addEventListener("DOMContentLoaded", function () { | document.addEventListener("DOMContentLoaded", function () { | ||
function replaceMarkerImage() { | |||
// Select all marker images in the marker pane | |||
// Select all marker images | |||
const markerImages = document.querySelectorAll('.leaflet-marker-pane img'); | const markerImages = document.querySelectorAll('.leaflet-marker-pane img'); | ||
markerImages.forEach(img => { | markerImages.forEach(img => { | ||
if (img.src.includes("tile.openstreetmap.org")) { | if (img.src.includes("tile.openstreetmap.org/v4/marker/pin-m+7e7e7e@2x.png")) { | ||
img.src = "https://schoolwiki.in/extensions/Kartographer/lib/external/mapbox/images/marker-icon-2x.png"; | img.src = "https://schoolwiki.in/extensions/Kartographer/lib/external/mapbox/images/marker-icon-2x.png"; | ||
} | } | ||
}); | }); | ||
} | } | ||
// Observe changes in the | // Observe dynamic changes in the marker pane | ||
const observer = new MutationObserver(() => replaceMarkerImage()); | |||
const mapPane = document.querySelector('.leaflet-pane.leaflet-marker-pane'); | const mapPane = document.querySelector('.leaflet-pane.leaflet-marker-pane'); | ||
if (mapPane) { | if (mapPane) { | ||
observer.observe(mapPane, { childList: true, subtree: true }); | observer.observe(mapPane, { childList: true, subtree: true }); | ||
} | } | ||
// Run the replacement function initially in case markers are already present | |||
replaceMarkerImage(); | |||
}); | }); | ||
തിരുത്തലുകൾ