Introduction
This is a Netscape plugin that can display routes, tracks, and waypoints from a GPX file. GPX (GPS eXchange) is an interchange format for GPS data. You can publish your GPS data online, and other people can use this plugin to view the data. It supports zooming and panning.
The plugin is written primarily for Firefox on GNU/Linux, but it should work with other browsers that support Netscape plugins. It may or may not work on other operating systems.
Building and installing the plugin
These build instructions are for GNU/Linux. They may work for other operating systems too, but I have no way to verify this.
This plugin uses the Qt GUI library, so you need to have a development package for Qt installed. It also uses the Qt Netscape plugin module, which isn't a standard part of the Qt library. You will need to download and build this module yourself, see the Qt documentation for details.
Once you have installed this module, these commands should build the plugin:
qmake gpxplugin.pro
make
This will create a library file (libnpgpx.so.1.0.0) and some links to that library file. Copy the library file to your plugin directory and rename it so it has an .so filename extension without any numbers, for example like this:
cp libnpgpx.so.1.0.0 ~/.mozilla/plugins/libnpgpx.so
Now restart your browser and type "about:plugins" in the location bar. The GPX Plugin should be listed - if not, something went wrong. You can test your plugin by loading the test.html page (which should have been distributed with this file).
Building and installing from CVS
The instructions above will not work if you have downloaded the code from the CVS repository instead of getting a source distribution. There is one additional step that you need to do before you build from CVS.
NPGPX uses waypoint icons to display different types of waypoints. These waypoint icons are embedded in the code when you get a source distribution, as byte arrays in the file symbols.h. This file does not exist in the CVS repository, instead you have a directory named "symbols" where all the icons are stored as PNG files. To get these files into the symbols.h header file you need to use the tool qembed. This tool is a part of the Qt package, but for some reason it isn't built by some distributions. You may have to build it yourself (it's in the directory tools/qembed in the Qt source code).
When you have qembed you should run this command, inside the symbols directory:
qembed *.png > ../symbols.h
This will create the header file symbols.h with all the PNG files embedded in it. After this you can build and install NPGPX just as you would do it from a source distribution.
Using the plugin
To publish a GPX file on your webpage you just add this HTML tag somewhere on the page:
<EMBED TYPE="text/gpx" SRC="arjeplog04.gpx" WIDTH=600 HEIGHT=600>
These attributes should ALWAYS be present:
- TYPE="text/gpx" - this tells the browser that the embedded object
is a GPX file so it knows which plugin to use
- SRC="arjeplog04.gpx" - this tells the plugin to load the GPX file
arjeplog04.gpx, you should change this to point to the GPX file you want to embed
- WIDTH=600 - this tells the plugin the width of the map in pixels,
you can change it to any value you want
- HEIGHT=600 - this tells the plugin the height of the map in
pixels, you can change it to any value you want
There are also optional attributes that can be used to customize the displayed map:
- GRID="off" - this turns off the lat/lon grid, default is "on"
- WPTLABELS="off" - this turns off the waypoint labels, default is "on"
- RTELABELS="off" - this turns off the route labels, default is "on"
- TRKLABELS="off" - this turns off the track labels, default it "on"
When you use the plugin to view a GPX file you can use the mouse to change the display in the following ways:
- Shift + LEFT mouse button - zoom in 2x and center on the mouse position
- Shift + RIGHT mouse button - zoom out 2x and center on the mouse position
- Shift + MIDDLE mouse button - center on the mouse position
Bugs, patches, suggestions
Should all be posted in the trackers on the SourceForge project page at http://www.sourceforge.net/projects/npgpx
Lars Luthman <larsl@users.sourceforge.net>
