mirror of
https://github.com/ddv2005/AirsoftTracker.git
synced 2025-07-27 15:19:32 +00:00
57 lines
2.4 KiB
HTML
57 lines
2.4 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>tiles</title>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.1/leaflet.css">
|
|
<link rel="stylesheet" href="https://cdn.rawgit.com/ardhi/Leaflet.MousePosition/master/src/L.Control.MousePosition.css">
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.1/leaflet.js" type="text/javascript"></script>
|
|
<script src="https://cdn.rawgit.com/ardhi/Leaflet.MousePosition/master/src/L.Control.MousePosition.js" type="text/javascript"></script>
|
|
<style>
|
|
html, body, #map { width:100%; height:100%; margin:0; padding:0; z-index: 1; background: #ffffff; }
|
|
#slider{ position: absolute; top: 10px; right: 10px; z-index: 5; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="map"></div>
|
|
<input id="slider" type="range" min="0" max="1" step="0.1" value="1" oninput="layer.setOpacity(this.value)">
|
|
<script type="text/javascript">
|
|
var mapExtent = [-8340140.79320000, 4827393.46432224, -8339268.82140956, 4828367.83280000];
|
|
var mapMinZoom = 1;
|
|
var mapMaxZoom = 3;
|
|
var mapMaxResolution = 0.50000000;
|
|
var mapMinResolution = Math.pow(2, mapMaxZoom) * mapMaxResolution;
|
|
var tileExtent = [-8340140.79320000, 4827393.46432224, -8339268.82140956, 4828367.83280000];
|
|
var crs = L.CRS.Simple;
|
|
crs.transformation = new L.Transformation(1, -tileExtent[0], -1, tileExtent[3]);
|
|
crs.scale = function(zoom) {
|
|
return Math.pow(2, zoom) / mapMinResolution;
|
|
};
|
|
crs.zoom = function(scale) {
|
|
return Math.log(scale * mapMinResolution) / Math.LN2;
|
|
};
|
|
var layer;
|
|
var map = new L.Map('map', {
|
|
maxZoom: mapMaxZoom,
|
|
minZoom: mapMinZoom,
|
|
crs: crs
|
|
});
|
|
|
|
layer = L.tileLayer('{z}/{x}/{y}.png', {
|
|
minZoom: mapMinZoom, maxZoom: mapMaxZoom,
|
|
tileSize: L.point(240, 240),
|
|
attribution: 'Rendered with <a href="https://www.maptiler.com/desktop/">MapTiler Desktop</a>',
|
|
noWrap: true,
|
|
tms: false
|
|
}).addTo(map);
|
|
map.fitBounds([
|
|
crs.unproject(L.point(mapExtent[2], mapExtent[3])),
|
|
crs.unproject(L.point(mapExtent[0], mapExtent[1]))
|
|
]);
|
|
L.control.mousePosition().addTo(map)
|
|
</script>
|
|
</body>
|
|
</html>
|