WebView_XP

There are a lot of great websites out there that take a latitude and longitude string in the url. This proof-of-concept shows how to output your X-Plane location to a very lightweight, pure-Python WebView browser moving map.

Starting with some code that Tim Trueman had posted for reading X-Plane UDP, this actually turned out to be a pretty easy implementation using wxPython’s wx.html2 module. The trick is using wxreactor for use with Twisted otherwise you’ll never get the Twisted thread to hand back over to wxPython.

WebView_XP.py displays a blue airplane icon at your current location on top of the browser. The plane points in the direction of your current heading. Up to seven additional planes are also plotted. As you fly, the aircraft icons are continuously updated based on new location and heading data. When you fly to the edge of the current map window the map window is reloaded with your location re-centered.

Hotkey ‘h’ toggles display of aircraft altitude and hotkey ‘b’ toggles display of additional aircraft icons.

It also shows windspeed and direction (with a rotating vane) in a small panel at the top left of the browser.

USAGE

1. Follow setup instructions found in download pdf.

2. Run WebView_XP.py and a small browser window will appear and update with your selected website when datagram packets are received from X-Plane.

DEPENDENCIES

– mercator.py included with download; place in same directory as WebView.py

– wxPython http://www.wxpython.org/download.php

– Twisted https://twistedmatrix.com/trac/wiki/Downloads

Additionally for Windows:

– Zope https://pypi.python.org/pypi/zope.interface/3.8.0

– Python for Windows Extensions http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/

DOWNLOAD

Download WebView_XP.py

ControlStatus

ControlStatus