"മീഡിയവിക്കി:Common.js" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം
(ചെ.)No edit summary |
(ചെ.)No edit summary |
||
| വരി 1: | വരി 1: | ||
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript'); | mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript'); | ||
document.addEventListener("DOMContentLoaded", function () { | document.addEventListener("DOMContentLoaded", function () { | ||
// | // Wait for the map to load fully | ||
const observer = new MutationObserver(() => { | |||
// Select all marker images within the leaflet-marker-pane | |||
const markerImages = document.querySelectorAll('.leaflet-marker-pane img'); | |||
markerImages.forEach(img => { | |||
if (img.src.includes("tile.openstreetmap.org")) { | |||
img.src = "https://schoolwiki.in/extensions/Kartographer/lib/external/mapbox/images/marker-icon-2x.png"; | |||
} | |||
}); | |||
}); | }); | ||
// Observe changes in the leaflet-marker-pane | |||
const mapPane = document.querySelector('.leaflet-pane.leaflet-marker-pane'); | |||
if (mapPane) { | |||
observer.observe(mapPane, { childList: true, subtree: true }); | |||
} | |||
}); | }); | ||