-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathVisualize.py
More file actions
96 lines (74 loc) · 2.33 KB
/
Visualize.py
File metadata and controls
96 lines (74 loc) · 2.33 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
import csv
def main():
GPSpointsFile=open('GPSPoints.txt','r')
GPSPoints=csv.reader(GPSpointsFile)
GPSPoints=list(GPSPoints)
fo = open('visualize.html', 'w')
Header="""<!DOCTYPE html>
<html>
<head>
<title>Texas Motor Speedway Simulator Control lines</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#map {
height: 90%;
}
#current{
height: 10%;
}
</style>
</head>
<body>
<div id="map"></div>
<div id="current"></div>
<div id="List"></div>
<script>
function initMap() {
var myLatlng = {lat: 33.036998, lng: -97.281323};
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 17,
center: myLatlng,
mapTypeId: 'satellite'
});
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
draggable: true,
title: 'Click to zoom'
});
"""
fo.write(Header)
LocationDec="var locations = ["
fo.write(LocationDec)
i=0
while i < len(GPSPoints):
Locations = "[%s,%s]," %(GPSPoints[i][0],GPSPoints[i][1])
fo.write(Locations)
i+=1
fo.write('];')
Footer = """
poly = new google.maps.Polyline({
strokeColor: '#000000',
strokeOpacity: 1.0,
strokeWeight: 3
});
poly.setMap(map);
var path = poly.getPath();
for (i = 0; i < locations.length; i++) {
path.push(new google.maps.LatLng(locations[i][0], locations[i][1]));
};
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCZBP_xUomSDxJ207tr-pzGq_lGKN6ZMm8&callback=initMap">
</script>
</body>
</html>
"""
fo.write(Footer)