-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
102 lines (89 loc) · 2.68 KB
/
index.html
File metadata and controls
102 lines (89 loc) · 2.68 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
crossorigin="anonymous"
/>
<style>
#container {
width: 100%;
height: 90%;
display: flex;
align-items: center;
justify-content: center;
background-color: #3498db;
}
#map {
height: 40rem;
width: 40rem;
position: relative;
overflow: hidden;
}
/* Optional: Makes the sample page fill the window. */
html,
body {
height: 100%;
width: 100%;
}
</style>
<title>OuTrack</title>
</head>
<body>
<h1 style="text-align:center;">
Stevenson Event Center, Santa Cruz, CA 95064
<a style="text-align:center;font-size:25px;" href="./">(re-track)</a>
</h1>
<div id="container">
<div id="map"></div>
</div>
<script
src="https://js.radar.io/v1.1.0/radar.min.js"
integrity="sha384-9gzMIZTQDnuwordlQUv+j9r2TDNLAaKXhSk+p/1jZV0tlnDQ8Bu6YVmTbLIG+dRg"
crossorigin="anonymous"
></script>
<script type="text/javascript">
Radar.initialize('prj_live_pk_e9c1214782590224d7ebac0ea7169d18ba5a7c65');
Radar.setUserId('1');
Radar.setDescription('user1');
Radar.trackOnce(function(status, location, user, events) {
console.log(location);
let userLat = location.latitude;
let userLong = location.longitude;
console.log(userLat);
console.log(userLong);
startMap(userLat, userLong);
});
function formatCode(object) {
return JSON.stringify(object, null, ' ');
}
</script>
<script>
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: { lat: 0, lng: 0 },
zoom: 20
});
}
function startMap(lat, lng) {
map.setCenter({ lat, lng });
let mapUrl = `https://maps.googleapis.com/maps/api/geocode/json?latlng=${lat},${lng}&key=AIzaSyDsVwLB660--UUov-kebC8bFF_cy30FRMs`;
fetch(mapUrl).then(async response => {
let data = await response.json();
console.log(data);
});
}
</script>
<script
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDsVwLB660--UUov-kebC8bFF_cy30FRMs&callback=initMap"
async
defer
></script>
</body>
</html>