-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
75 lines (69 loc) · 2.54 KB
/
index.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
68
69
70
71
72
73
74
75
<!doctype html>
<html>
<head>
<title>LightMap demo</title>
<style type="text/css">
body {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light",
"Helvetica Neue", sans-serif;
font-weight: 300;
background: #f8f8f8;
margin-top: 0px;
margin-left: 0px;
margin-bottom: 0px;
margin-right: 0px;
}
div.content {
width: 100%;
height : 100%;
}
</style>
<script type="text/javascript" src="lightmap.min.js"></script>
<script type="text/javascript">
var map;
var viewportwidth;
var viewportheight;
var marker = null;
window.onload = function() {
if (typeof window.innerWidth != 'undefined'){// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
viewportwidth = window.innerWidth;
viewportheight = window.innerHeight;
}
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
else if (typeof document.documentElement != 'undefined'
&& typeof document.documentElement.clientWidth !=
'undefined' && document.documentElement.clientWidth != 0){
viewportwidth = document.documentElement.clientWidth;
viewportheight = document.documentElement.clientHeight;
}
else{// older versions of IE
viewportwidth = document.getElementsByTagName('body')[0].clientWidth;
viewportheight = document.getElementsByTagName('body')[0].clientHeight;
}
map = new LightMap({
id : "mapcanvas",
height: viewportheight,
width: viewportwidth,
zoom:14,
center: {lon:-99.15262006530759,lat:19.379173823369506},
controls:true,
container:"content"
});
map.getAllTiles();
setTimeout("marker = new map.Marker({lat:19.379173823369506,lon:-99.15262006530759,src:'resources/arrow.png',xoffset:10,yoffset:34});",500);
//setTimeout("marker.destroy()",10000);
//setTimeout("map.setCenter(19.379173823369506,-99.15262006530759);",600);
//setTimeout("map.setCenter(19.379173823369506,-99.15262006530759,14);",2000);
//setTimeout("map.setCenter(19.379173823369506,-99.15262006530759,13);",20000);
map.addCustomEvent("idle",function(){
console.log(map.withInViewport(marker.lat , marker.lon));
})
}
</script>
</head>
<body>
<div id="content" class="content">
<div id="mapcanvas"></div>
</div>
</body>
</html>