From 2766107a7618c88fec22a5d4404b5e97ebf5dc74 Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Fri, 21 Jun 2013 16:28:56 -0700 Subject: [PATCH] Small changes to map view. WebKit won't render files w/o .htm[l] extension so using a named temp file is out. --- apps/modes_gui | 6 ++++-- python/html_template.py | 33 +++++++++++++++++++++++++++++++-- python/kml.py | 21 ++++++++++++--------- 3 files changed, 47 insertions(+), 13 deletions(-) diff --git a/apps/modes_gui b/apps/modes_gui index 27c1e4b..1cf0fa0 100755 --- a/apps/modes_gui +++ b/apps/modes_gui @@ -290,7 +290,9 @@ class mainwindow(QtGui.QMainWindow): #self._relay.subscribe("dl_data", self.az_map_output.output) #set up map - self._htmlfile = open("/home/nick/wat.html", 'wb+')#tempfile.NamedTemporaryFile() + #NOTE this is busted on windows. WebKit requires .htm[l] extensions to render, + #so using a temp file doesn't work. + self._htmlfile = open("/tmp/mode_s.html", 'wb+')#tempfile.NamedTemporaryFile() self._jsonfile = tempfile.NamedTemporaryFile() self.livedata = air_modes.output_print(self._cpr_dec, self._publisher) @@ -308,7 +310,7 @@ class mainwindow(QtGui.QMainWindow): print '%s line %d: %s' % (source, line, msg) page = WebPage() self.ui.mapView.setPage(page) - self.ui.mapView.load( QtCore.QUrl( QtCore.QUrl.fromLocalFile("/home/nick/wat.html") ) ) + self.ui.mapView.load( QtCore.QUrl( QtCore.QUrl.fromLocalFile("/tmp/mode_s.html") ) ) self.ui.mapView.show() #output to update reports/sec widget diff --git a/python/html_template.py b/python/html_template.py index 1b2c154..068fd8e 100644 --- a/python/html_template.py +++ b/python/html_template.py @@ -11,6 +11,20 @@ def html_template(my_position, json_file): ADS-B Aircraft Map + +