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

No edit summary
fix map icon
വരി 1: വരി 1:
//Replace Map Marker with local icon
function replaceMarkerImage(newUrl) {
  // Get all image elements with the target class
  const imageElements = document.querySelectorAll('img.leaflet-marker-icon');
  // Loop through each image element
  imageElements.forEach(image => {
    // Attach a load event listener to the image
    image.addEventListener('load', function() {
      // Update the image source after it has loaded
      this.src = newUrl;
    });
  });
}
// Example usage:
const newImageUrl = 'https://schoolwiki.in/extensions/Kartographer/lib/external/mapbox/images/marker-icon-2x.png'; // Replace with the new URL
replaceMarkerImage(newImageUrl);
//Quick Edit Box  
//Quick Edit Box  
// [[User:BrandonXLF/QuickEdit.js]]
// [[User:BrandonXLF/QuickEdit.js]]
"https://schoolwiki.in/മീഡിയവിക്കി:Common.js" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്