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

665 ബൈറ്റുകൾ കൂട്ടിച്ചേർത്തിരിക്കുന്നു ,  20 ജൂലൈ 2024
fix map icon
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/പ്രത്യേകം:മൊബൈൽവ്യത്യാസം/2522771" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്