-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
65 lines (64 loc) · 2.99 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
<!DOCTYPE html>
<html>
<head>
<title>VATSIM ACS Generator</title>
<link rel="icon"
href="https://d30y9cdsu7xlg0.cloudfront.net/png/1753-200.png">
</head>
<body style="margin: 0;">
<div id="map" style="width: 100px; height: 100px; display: inline-block; float: right;">
</div>
<script src="generatecallsign.js"></script>
<script src="routes.js"></script>
<script src="getRoute.js"></script>
<script src="genicao.js"></script>
<script src="genarpt.js"></script>
<script src="genflight.js"></script>
<script>
function myMap() {
var mapOptions = {
center: new google.maps.LatLng(40.64,-73.78),
zoom: 14,
mapTypeId: google.maps.MapTypeId.HYBRID,
maxZoom: 17
}
var map = new google.maps.Map(document.getElementById("map"), mapOptions)
map.addListener('click', function(event) {
console.log("Write");
displayCoordinates(event.latLng);
});
}
function displayCoordinates(pnt) {
var coordsLabel = document.getElementById("textLoc");
var lat = pnt.lat();
lat = lat.toFixed(10);
var lng = pnt.lng();
lng = lng.toFixed(10);
console.log(document.getElementById("heading").value);
coordsLabel.innerHTML += genFlight(lat, lng, document.getElementById("altitude").value, document.getElementById("heading").value, document.getElementById("airport").value) + "\n";
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCw_8PQoMzOB3T9F-s1oRS6UJjZ7wvpuQc&callback=myMap"></script>
<div id="tdCursor" style="padding-right: 10px; padding-top: 0; display: inline-block; float: left;">
<form style="margin-bottom:20px;">
<textarea style="resize: none; padding:0; margin:0;" onclick="this.focus();this.select()" readonly="readonly" id="textLoc"></textarea><br>
<p style="display:inline-block; padding-right:10px; padding-left: 20px;">Altitude:</p>
<input placeholder="10000" style="display:inline-block;" id="altitude">
<p style="display:inline-block; padding-left:20px; padding-right:10px;">Heading:</p>
<input placeholder="080" style="display:inline-block;" id="heading"><br>
<p style="display:inline-block; padding-left:20px; padding-right: 10px;">Airport Code:</p>
<input placeholder="KJFK" style="display:inline-block; margin-right:50px;" id="airport">
<button onclick="document.getElementById('textLoc').innerHTML='';" type="reset" value="reset">Reset</button>
</form>
</div>
<script>
console.log(screen.width);
var wid = window.innerWidth;
var hei = window.innerHeight;
document.getElementById("map").style.width = wid / 3 * 2 + "px";
document.getElementById("map").style.height = hei + "px";
document.getElementById("textLoc").style.width = wid / 3 - 30 + "px";
document.getElementById("textLoc").style.height = hei - 120 + "px";
</script>
</body>
</html>