"മീഡിയവിക്കി:Common.js" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

തിരുത്തലിനു സംഗ്രഹമില്ല
(ചെ.)No edit summary
No edit summary
വരി 2: വരി 2:


document.addEventListener("DOMContentLoaded", function () {
document.addEventListener("DOMContentLoaded", function () {
     function replaceMarkerImage() {
     setInterval(function () {
        // Select all marker images in the marker pane
         const markerImages = document.querySelectorAll('img[src="https://tile.openstreetmap.org/v4/marker/pin-m+7e7e7e@2x.png"]');
         const markerImages = document.querySelectorAll('.leaflet-marker-pane img');
         markerImages.forEach(img => {
         markerImages.forEach(img => {
             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";
            }
         });
         });
     }
     }, 500);
 
    // Observe dynamic changes in the marker pane
    const observer = new MutationObserver(() => replaceMarkerImage());
    const mapPane = document.querySelector('.leaflet-pane.leaflet-marker-pane');
 
    if (mapPane) {
        observer.observe(mapPane, { childList: true, subtree: true });
    }
 
    // Run the replacement function initially in case markers are already present
    replaceMarkerImage();
});
});


"https://schoolwiki.in/പ്രത്യേകം:മൊബൈൽവ്യത്യാസം/2624733" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്