-
Notifications
You must be signed in to change notification settings - Fork 1
/
index_ipad.html
77 lines (67 loc) · 1.81 KB
/
index_ipad.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
76
77
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0,
maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet"
href="http://api.maps.nokia.com/mobile/1.0.2/lib/mh5.css">
<link rel="stylesheet"
href="http://api.maps.nokia.com/mobile/1.0.2/lib/colors.css">
</head>
<body class="mh5_hwacc_body">
<script src="http://api.maps.nokia.com/mobile/1.0.2/lib/mh5.js">
</script>
<script src="/lib/client/javascript/StompJms.js">
</script>
<script src="tripzing.js">
</script>
<div id="mapContainer"
style="width: 768px; height: 1024px; position: relative;">
</div>
<script>
nokia.mh5.assetsPath = "http://api.maps.nokia.com/mobile/1.0.2/lib/";
nokia.mh5.appId = "_peU-uCkp-j8ovkzFGNU";
nokia.mh5.appCode = "gBoUkAMoxoqIWfxWA5DuMQ";
var currentPosition;
var map;
// get current location
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
currentPosition = position;
loadMap();
});
}
function loadMap() {
map = new nokia.mh5.components.Map({
center: {
longitude: currentPosition.coords.longitude,
latitude: currentPosition.coords.latitude
},
schema: "normal.day.traffic"
});
document.getElementById("mapContainer").appendChild(map.root);
/*var poi = map.createPoi("bryce.png",currentPosition.coords);
setTimeout(function(){
map.removePoi(poi);
}, 2000);*/
var pois = {};
doConnect(function(message, userId){
var currentPoi = pois[userId];
if(currentPoi) {
map.removePoi(currentPoi);
}
var coords = message.split(",");
var coordinate = {
longitude:coords[1],
latitude:coords[0]
};
currentPoi = map.createPoi(userId + ".png",coordinate);
pois[userId] = currentPoi;
if (!map.covers([coordinate])) {
map.moveTo(coordinate);
}
});
}
</script>
</body>
</html>