forked from jetelain/Arma3Map
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
54 lines (48 loc) · 1.8 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tanoa</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css" />
<link rel="stylesheet" href="https://jetelain.github.io/Arma3Map/css/mapUtils.css" />
</head>
<body style=" margin:0;padding:0;border:0;">
<div class="map" id="map" style="width:100%; height:100vh; margin:0;padding:0;border:0;">
</div>
<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js">
</script>
<script src="https://unpkg.com/jquery@3.5.1/dist/jquery.min.js">
</script>
<script src="https://jetelain.github.io/Arma3Map/js/mapUtils.js">
</script>
<script>
// Define a InitMap function, it will callbacked by the .js file on the map with relevant data
function InitMap(mapInfos) {
$(function () {
// Create map control
var map = L.map('map', {
minZoom: mapInfos.minZoom,
maxZoom: mapInfos.maxZoom,
crs: mapInfos.CRS
});
// Define tile layer
L.tileLayer('https://jetelain.github.io/Arma3Map' + mapInfos.tilePattern, {
attribution: mapInfos.attribution,
tileSize: mapInfos.tileSize
}).addTo(map);
// Center map, and sets default zoom
map.setView(mapInfos.center, mapInfos.defaultZoom);
// (optional) Add grid sliders
L.latlngGraticule().addTo(map);
// (optional) Add a scale control
L.control.scale({ maxWidth: 200, imperial: false }).addTo(map);
// (optional) Add mouse grid position
L.control.gridMousePosition().addTo(map);
});
}
</script>
<script src="https://jetelain.github.io/Arma3Map/maps/tanoa.js">
</script>
</body>
</html>