Skip to content
Cartograph Maps

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

  1. Open the sensor manager: Sensors in the main menu.
  2. Tap + → Webserver GPS source. The entry Webserver GPS is added.
  3. Tap it → Options to set the Port (default 5000). Two options decide which values of the requests are used: Altitude and Speed (both on).
  4. 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
ParameterRequiredWhat it is
latyeslatitude in decimal degrees (WGS84)
lonyeslongitude in decimal degrees
tsyestime as a Unix timestamp in seconds
altnoaltitude in metres
haccnohorizontal accuracy in metres
vaccnovertical accuracy in metres
dirnobearing in degrees (0 = north)
speednospeed 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