Main Map: Difference between revisions

From The Lands Of Liberos Project

Content added Content deleted
(Created page with "var map = L.map('map', { crs: L.CRS.Simple }); var bounds = [[0,0], [1000,1000]]; var image = L.imageOverlay('uqm_map_full.png', bounds).addTo(map); map.fitBounds(bounds);")
 
No edit summary
Line 1: Line 1:
<!doctype html>
var map = L.map('map', {
<html>
crs: L.CRS.Simple
<head>
});
<title>Map test</title>
var bounds = [[0,0], [1000,1000]];
<style type="text/css">
var image = L.imageOverlay('uqm_map_full.png', bounds).addTo(map);
html, body { height: 100%; margin: 0; padding: 0; }
map.fitBounds(bounds);
#map { width: 1660px; height: 1000px; }
</style>
<link rel="stylesheet" href="js/leaflet/leaflet.css" type="text/css"/>
<script type="text/javascript" src="js/leaflet/leaflet.js"></script>
</head>
<body>
<div id="map"></div>
<script type="text/javascript">
var map = L.map('map', {
crs: L.CRS.Simple,
center: [500, 880],
minZoom: 0,
maxZoom: 2,
zoom: 0
});
var bounds = [[0,0], [1000,1660]];
var image = L.imageOverlay('img/fantasy_map.jpg', bounds).addTo(map);
map.setMaxBounds(bounds);
map.on('drag', function() {
map.panInsideBounds(bounds, { animate: false });
});
</script>
</body>
</html>

Revision as of 18:35, 25 January 2024

<!doctype html> <html> <head> <title>Map test</title> <style type="text/css"> html, body { height: 100%; margin: 0; padding: 0; } #map { width: 1660px; height: 1000px; } </style> <link rel="stylesheet" href="js/leaflet/leaflet.css" type="text/css"/> <script type="text/javascript" src="js/leaflet/leaflet.js"></script> </head> <body>

<script type="text/javascript"> var map = L.map('map', { crs: L.CRS.Simple, center: [500, 880], minZoom: 0, maxZoom: 2, zoom: 0 }); var bounds = [[0,0], [1000,1660]]; var image = L.imageOverlay('img/fantasy_map.jpg', bounds).addTo(map); map.setMaxBounds(bounds); map.on('drag', function() { map.panInsideBounds(bounds, { animate: false }); }); </script> </body> </html>

Cookies help us deliver our services. By using our services, you agree to our use of cookies.