diff --git a/simplemap/__init__.pyc b/simplemap/__init__.pyc
index a4669ce..632476f 100644
Binary files a/simplemap/__init__.pyc and b/simplemap/__init__.pyc differ
diff --git a/simplemap/html_render.pyc b/simplemap/html_render.pyc
index 46fbe31..b8edcb1 100644
Binary files a/simplemap/html_render.pyc and b/simplemap/html_render.pyc differ
diff --git a/simplemap/map.pyc b/simplemap/map.pyc
index 2a4e352..47413e2 100644
Binary files a/simplemap/map.pyc and b/simplemap/map.pyc differ
diff --git a/simplemap/templates/basic.html b/simplemap/templates/basic.html
index 18787b9..522be8e 100644
--- a/simplemap/templates/basic.html
+++ b/simplemap/templates/basic.html
@@ -4,14 +4,12 @@
{{map_title}}
+
Waypointer
-
{{ message|safe }}
@@ -19,12 +17,6 @@
Waypointer
function initMap() {
- /*var message = "{{ message|safe }}";
- //If a message has been added to the alert system be sure to write it.
- if (message) {
- alert(message);
- }*/
-
var bounds = new google.maps.LatLngBounds();
var center_lat_lon = {{center|safe}};
@@ -32,13 +24,12 @@
Waypointer
zoom: {{ zoom|safe }},
center: center_lat_lon
});
-
+ // markers is the actual pins you'll see on gmaps.
var markers = {{ markers|safe }};
- //points need to be {lon:5.4..., lng:6.342...}
- var points = {{ points|safe }}
+ //points are close to markers but formatted differently as the flightPath var needs it like so.
+ var points = {{ points|safe }};
- //Doing this on the 'lines' branch
- //Draw a line from point to point, not working currently.
+ // flightPath takes the points and draws lines between them all.
var flightPath = new google.maps.Polyline({
path: points,
geodesic: true,
diff --git a/simplemap/templates/static/css/basic.css b/simplemap/templates/static/css/basic.css
index ac29641..7413b51 100644
--- a/simplemap/templates/static/css/basic.css
+++ b/simplemap/templates/static/css/basic.css
@@ -3,14 +3,16 @@ html, body {
margin: 0;
padding: 0;
}
-
+/* Width at 80% for sidebar */
#map {
height: 100%;
width: 80%;
}
-
+/* sidebar on the right of the screen,
+ because it's not always relavant. */
#sidebar {
float:right;
margin-right: 1%;
overflow: auto;
+ font-family: 'Ubuntu', sans-serif;
}
\ No newline at end of file
diff --git a/waypointer.py b/waypointer.py
index 3fdd538..c9ab55c 100644
--- a/waypointer.py
+++ b/waypointer.py
@@ -1,6 +1,8 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
-# @author Tom Nicklin
+### @author Tom Nicklin
+# This has been specifically set up for the GroundStation application data tables.
+# more file types and diffferent SQL querys will change based on new information.
from datetime import datetime
import simplemap
@@ -23,7 +25,7 @@
alert = ''
-# In an effor to make this system more modular the user passes in a sequence number and table for the waypoints.
+# In an effort to make this system more modular the user passes in a sequence number and table for the waypoints.
# this is that argument system. It still doesn't seem right to me but I've tested it enough that it works.
if __name__ == '__main__':
if len(sys.argv) == 3:
@@ -99,22 +101,23 @@ def get_alert(database):
#from import datetime library you can simply convert seconds elapsed from 1/1/1970 to get a date. Which is what we are doing here.
date = datetime.fromtimestamp(timeinseconds)
# Finally we return the string of relevant info that'll eventually be inserted into the alert box.
- get_alertOutput = "Sequence: " + str(sequence) + " Flown on: " + str(date) + " UUID: " + str(uuid)
+ get_alertOutput = "Sequence: " + str(sequence) + "
Flown on: " + str(date) + "
UUID: " + str(uuid)
return get_alertOutput
except:
return 'Could not retrieve either UUID or date from database.'
-
+# Here we change the formatting of the waypoints so gmaps api can use them to plot lines
def make_points(coords):
if(coords):
+ # Firstly we don't need the way point number in this as we already have our waypoints in order.
for x in range(0, len(coords)):
coords[x].pop(0)
- #coords[x] = str(coords[x])
- coords[x] = str(coords[x]).replace("[", "{lat: ").replace(",", ", lng:").replace("]", "}")
- #coords[x].replace(",", ", lng:")
- #coords[x].replace("]", "}")
- print '\n', coords[x]
- return coords
+ # List comprehensions are fun. Basically telling it the format I want and then it has its
+ # own little for loop and then changes all elements. It's more obvious when you look at
+ # var points in a generated html file.
+ new_list = [{'lat': d[0], 'lng': d[1]} for d in coords]
+ # Return the new list after the list comprehension.
+ return new_list
@@ -130,16 +133,8 @@ def make_points(coords):
gps_markers = get_coordinates(db)
# This gets the information to display in the alert pop up box
alert = get_alert(db)
-
-
-#Test
-plots = make_points(get_coordinates(db))
-
-print plots
-
-#print plots[0]
-#print type(plots[0])
-#print str(plots[0]).replace("[", "{lat: ").replace(",", ", lng:").replace("]", "}")
+# This will take the points and make sure they can be used to make lines on the map
+plots = make_points(gps_markers)
# Here we generate the html page by passing the above
# information to the relevant files
diff --git a/waypointer.pyc b/waypointer.pyc
new file mode 100644
index 0000000..298df11
Binary files /dev/null and b/waypointer.pyc differ