Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

MediaWiki:Gadget-TreeverseMap.js

MediaWiki interface page
Revision as of 22:11, 26 August 2025 by QTPi (talk | contribs) (Created page with "mw.loader.using('ext.maps.leaflet', function () { var mapDiv = document.getElementById('treeverse-map'); if (!mapDiv) return; // Size of your image var w = 2000, h = 2000; // Create the map var map = L.map(mapDiv, { crs: L.CRS.Simple, minZoom: -2 }); // Calculate image bounds var bounds = [[0,0], [h,w]]; // Use your uploaded map image L.imageOverlay('/wiki/File:TreeverseMap3.jpeg?download', bounds).addTo(map); // Fit map to image ma...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
mw.loader.using('ext.maps.leaflet', function () {
  var mapDiv = document.getElementById('treeverse-map');
  if (!mapDiv) return;

  // Size of your image
  var w = 2000, h = 2000;

  // Create the map
  var map = L.map(mapDiv, {
    crs: L.CRS.Simple,
    minZoom: -2
  });

  // Calculate image bounds
  var bounds = [[0,0], [h,w]];

  // Use your uploaded map image
  L.imageOverlay('/wiki/File:TreeverseMap3.jpeg?download', bounds).addTo(map);

  // Fit map to image
  map.fitBounds(bounds);

  // Add example marker
  L.marker([1000, 1500]).addTo(map)
    .bindPopup("Crystal Cave – rare ores spawn here");
});