-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.html
More file actions
70 lines (63 loc) · 2.34 KB
/
map.html
File metadata and controls
70 lines (63 loc) · 2.34 KB
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
68
69
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<!-- general css -->
<link type="text/css" rel="stylesheet" href="./css/map.css"></link>
<!-- mapbox -->
<script src="https://api.tiles.mapbox.com/mapbox.js/v2.2.1/mapbox.js"></script>
<link href="https://api.tiles.mapbox.com/mapbox.js/v2.2.1/mapbox.css" rel="stylesheet" />
<!-- DLM -->
<script src="./js/jquery-2.1.4.js"></script>
<script src="./js/jquery.dlm.js"></script>
<script src="./js/dirData.js"></script>
<!-- tn3 -->
<link type="text/css" rel="stylesheet" href="./skins/tn3/tn3.css"></link>
<script type="text/javascript" src="js/tn3/jquery.tn3lite.min.js"></script>
<title>DLM - Draw Life Map</title>
</head>
<body>
<button id="previous" class="button"><<</button>
<button id="next" class="button">>></button>
<div id="myMap"></div>
<div id="list" class="list"></div>
<div id="info" class="info"></div>
<script type="text/javascript" charset="utf-8">
function getReq(variable){
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0; i<vars.length; i++){
var pair = vars[i].split("=");
if(pair[0] == variable && pair[1] != "undefined")
return pair[1];
}
return(false);
}
$(document).ready(function(){
var token = getReq("token") ? getReq("token") : "pk.eyJ1IjoibWFwYm94IiwiYSI6IlhHVkZmaW8ifQ.hAMX5hSW-QnTeRCMAy9A8Q";
var mapboxId = getReq("mapboxId") ? getReq("mapboxId") : "mapbox.streets";
var mapName = getReq("mapName") ? unescape(getReq("mapName")) : 0;
var lat = getReq("lat") ? getReq("lat") : 22.9870689;
var lng = getReq("lng") ? getReq("lng") : 120.2735845;
var view = [lat, lng];
var zoom = getReq("zoom") ? getReq("zoom") : 11;
$("#myMap").dlm({
"token": token,
"mapboxId": mapboxId,
"mapName": mapName,
"view": view,
"zoom": zoom,
"dirData": dirData,
});
$("#myMap").dlm("show");
var $mytn3 = $(".info").tn3({
init_start:function(e){}
}).data("tn3");
$("#info").fadeOut();
});
$("#previous").click(function(){$("#myMap").dlm("previous")});
$("#next").click(function(){$("#myMap").dlm("next")});
</script>
</body>
</html>