MediaWiki:Gadget-TreeverseMap.js
MediaWiki interface page
More actions
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");
});