-
Notifications
You must be signed in to change notification settings - Fork 32
/
all.html
67 lines (57 loc) · 2.27 KB
/
all.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Malden</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">
<link rel="stylesheet" href="css/mapUtils.css" />
</head>
<body style=" margin:0;padding:0;border:0;">
<div class="map" id="map" style="width:80%; height:100vh; margin:0;padding:0;border:0;">
</div>
<div id="maplist" style="width:20%; height:100vh; margin:0;padding:0.5em;border:0; position:absolute; top:0px; right:0px; overflow-y:scroll;">
<p>Maps</p>
</div>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js">
</script>
<script src="https://unpkg.com/[email protected]/dist/jquery.min.js">
</script>
<script src="js/mapUtils.js">
</script>
<script src="js/defaultMap.js">
</script>
<script src="maps/all.js">
</script>
<script>
var map = null;
function setmap(mapInfos)
{
if ( map ) map.remove();
map = L.map('map', {
minZoom: mapInfos.minZoom,
maxZoom: mapInfos.maxZoom,
crs: mapInfos.CRS
});
L.tileLayer('.'+mapInfos.tilePattern, {
attribution: mapInfos.attribution,
tileSize: mapInfos.tileSize
}).addTo(map);
map.setView(mapInfos.center, mapInfos.defaultZoom);
L.latlngGraticule().addTo(map);
L.control.scale({ maxWidth: 200, imperial: false }).addTo(map);
L.control.gridMousePosition().addTo(map);
}
$(function(){
setmap(Arma3Map.Maps.altis);
Object.keys(Arma3Map.Maps).forEach(key => {
var infos = Arma3Map.Maps[key];
var card = $('<div class="card bg-dark text-white mb-3" style="max-height:150px; overflow:hidden;"><a href="#" class="text-white"><img src="'+infos.preview+'" class="card-img" alt="..."><div class="card-img-overlay"><h5 class="card-title" style="text-shadow: #000 1px 0 10px;">'+infos.title+'</h5></div></a></div>');
card.click(function(){setmap(infos);});
$(maplist).append(card);
});
});
</script>
</body>
</html>