forked from spencerdrak/trackinDragon
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
97 lines (94 loc) · 3.06 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<!--The Google Geocode API formed the template for this code-->
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Trackin' Dragon</title>
<!--I used Guillermo Ruffino's answer to format CSS to stack things side by side: https://stackoverflow.com/questions/2637696/how-to-place-div-side-by-side-->
<style>
#map {
height: 90%;
}
#uploader {
height: 10%;
}
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#uploader {
display: inline-block;
vertical-align:top;
}
#unfoundDisplay {
display: inline-block;
padding-left: 40px;
vertical-align:top;
}
#instructions {
display: inline-block;
padding-left: 10px;
vertical-align:top;
}
#pic {
display: inline-block;
padding-left: 10px;
vertical-align:top;
}
</style>
</head>
<body>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDAAGsJRA7pJaG5u8SvrwJWRTkFAxkCaXg&callback=initMap">
</script>
<script>
var formatted;
var result;
var map;
var markers = [];
var compPath;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
zoom: 5,
center: {lat: 36.263110, lng: -99.079066},
mapTypeId: 'terrain'
});
}
</script>
<!-- I adapted the answer from Maloric on the following Stackoverflow answer to help upload the JSON to the page:
https://stackoverflow.com/questions/36127648/uploading-a-json-file-and-using-it-->
<div id="uploader">
<script type="text/javascript" src="./upload.js"></script>
<input type="file" id="selectFiles" value="Import"><br>
<button id="import">Import</button>
<input onclick="deleteMarkersAndPath();" type=button value="Delete Markers">
<script>
//I used Avarind Asok's answer to delete the lines from the path. https://stackoverflow.com/questions/9511474/google-maps-api-v3-remove-all-polylines
// I also used Google Maps API for how to delete the markers.
function deleteMarkersAndPath() {
for (var i = 0; i < markers.length; i++) {
markers[i].setMap(null);
document.getElementById('unfound').innerHTML = "";
}
markers = [];
compPath.setMap(null);
}
</script>
</div>
<div id="unfoundDisplay">
<p>These SSID/BSSID pairs could not be found on WiGLE or Google Geocode API.</p>
<p id="unfound"></p>
</div>
<div id="instructions">
<p>The red IDs are those found on the WiGLE API, with a high degree of confidence.</p>
<p>The blue IDs are those found via Google API, with a lower degree of confidence.</p>
<p id="unfound"></p>
</div>
<div id="pic">
<img src="trackinDragon.jpg" alt="Trackin' Dragon" width="220" height="150">
</div>
<div id="map"></div>
</body>
</html>