Webserver GPS source
The webserver GPS source lets another program send positions to Cartograph Maps. The app then uses them like positions from a GPS receiver: the map follows them, and you can record and navigate with them. It is useful for simulators, external GPS devices with their own software, or for testing.
It is available on Windows and macOS.
Add the source
- Open the sensor manager: Sensors in the main menu.
- Tap + → Webserver GPS source. The entry Webserver GPS is added.
- Tap it → Options to set the Port (default 5000). Two options decide which values of the requests are used: Altitude and Speed (both on).
- Turn the entry on with its switch. The app now listens on that port, on all network interfaces of the computer.
Turn off System GPS in the same list if the computer’s own location should not mix with the positions you send.
With Altitude off, the app ignores the alt of the requests: the altitude then comes from
elevation data if Use altitude from DEM model is on in the
sensor settings, otherwise there is none. With Speed off, it
ignores speed; the speed then comes only from a Bluetooth speed sensor.
Send a position
Send an HTTP GET request with the values as query parameters:
http://localhost:5000/?lat=48.051&lon=16.328&ts=1764320000&alt=100&hacc=20&vacc=50&dir=20&speed=10
| Parameter | Required | What it is |
|---|---|---|
lat | yes | latitude in decimal degrees (WGS84) |
lon | yes | longitude in decimal degrees |
ts | yes | time as a Unix timestamp in seconds |
alt | no | altitude in metres |
hacc | no | horizontal accuracy in metres |
vacc | no | vertical accuracy in metres |
dir | no | bearing in degrees (0 = north) |
speed | no | speed in metres per second |
The app answers with JSON: {"result":"ok"}, or an error when lat, lon or ts is missing.
The answer allows requests from web pages (Access-Control-Allow-Origin: *).
The positions go through the same filters as GPS positions (Max. position error, Min.
distance, see Sensor manager). Send a realistic hacc, or none, if
your positions seem to be ignored.
From another computer, use the IP address of the computer running Cartograph Maps instead of
localhost, and allow the port in its firewall. There is no password: only use it in a network
you trust.
Example
With curl, every second:
while true; do
curl -s "http://localhost:5000/?lat=48.2082&lon=16.3738&ts=$(date +%s)&hacc=5"
sleep 1
done