<<back

API Overview.

QuakeMap can be controlled via two mechanisms: command line arguments and a library-style API. Both methods are described below. Two sample applications are provided (full source code): one demonstrates all API functions and another imports NTSB aviation accident data.

Possible applications include data import/conversions, real-time vehicle and mobile phones tracking, data analysis.

1. Command line arguments.

QuakeMap treats any argument not starting with a "/" as a file name. It also accepts the following arguments in the command line:

The order of arguments and files does not matter. If file(s) are specified without any of coordinate-related values (/lat, /lon or /elev), a zoom will be performed to show all opened files on the map. Coordinates override the zoom and place the Camera in specified location.

If QuakeMap is not already running, a command will bring it up with specified parameters. If it is running, a new instance of QuakeMap will send an API message to the running instance, which will actually perform the command.

Here are some examples:

"C:\Program Files\VitalBytes\QuakeMap\bin\quakemap.exe"  /lat=47.55 /lon=-122.135 /map=color /elev=500
"C:\Program Files\VitalBytes\QuakeMap\bin\quakemap.exe"  /lat=34.123 /lon=-117.234 /elev=5000
"C:\Program Files\VitalBytes\QuakeMap\bin\quakemap.exe"  /lat=34.123 /lon=-117.234 /map=topo
"C:\Program Files\VitalBytes\QuakeMap\bin\quakemap.exe"  /lat=34.123 /lon=-117.234 /map=aerial
"C:\Program Files\VitalBytes\QuakeMap\bin\quakemap.exe"  /lat=34.123 /lon=-117.234 /map=color
"C:\Program Files\VitalBytes\QuakeMap\bin\quakemap.exe"  /lat=34.123 /lon=-117.234 /map=topo "C:\Projects\Waypoints\realTime\garm2.gpx"
"C:\Program Files\VitalBytes\QuakeMap\bin\quakemap.exe"  /lat=33.582 /lon=-117.648 /map=topo "C:\Projects\Waypoints\realTime\garm2.gpx" "C:\Projects\Waypoints\realTime\garm1.gpx"
"C:\Program Files\VitalBytes\QuakeMap\bin\quakemap.exe"  /lat=33.582 /lon=-117.648 /map=topo "C:\Projects\Waypoints\realTime\garm2.gpx" "C:\Projects\Waypoints\realTime\garm1.gpx" /elev=2000
"C:\Program Files\VitalBytes\QuakeMap\bin\quakemap.exe"  /lat=34.123 /lon=-117.234 /map=topo /elev=5000
"C:\Program Files\VitalBytes\QuakeMap\bin\quakemap.exe"  "C:\Projects\Waypoints\realTime\garm2.gpx" "C:\Projects\Waypoints\realTime\garm1.gpx" /elev=2000
"C:\Program Files\VitalBytes\QuakeMap\bin\quakemap.exe"  "C:\Projects\Waypoints\realTime\garm2.gpx" "C:\Projects\Waypoints\realTime\garm1.gpx"
"C:\Program Files\VitalBytes\QuakeMap\bin\quakemap.exe"  /lat=33.582 /lon=-117.648 /elev=2000 /map=topo "C:\Projects\Waypoints\realTime\garm2.gpx" "C:\Projects\Waypoints\realTime\garm1.gpx"
"C:\Program Files\VitalBytes\QuakeMap\bin\quakemap.exe"  /lat=34.123 /lon=-117.234 /elev=2000 /map=topo

You can use the command line style from your scripts or programs. There is an overhead of calling a new instance of quakemap.exe which lives only to create a message to the active QuakeMap process. The command line API is also not meant to be complete, there will be more functions supported at the programmatic API level.

2. Programmatic API.

QuakeMap receives string messages using Windows messaging api. Complete code sample below contains the messaging code and is self-explanatory. Use API to take advantage of faster communication and full set of commands.

Code Sample 1 - test API functions. -- click here.

Code Sample 2 - import NTSB aviation accident data. -- click here.