Map Widget
The Map widget renders an interactive map and places a marker at the latitude/longitude reported by the device. Ideal for vehicle tracking, drone telemetry, asset monitoring, and mobile devices.
Default size: 3 × 3 grid cells
Configuration
| Property | Type | Default | Description |
|---|---|---|---|
mapType | street | satellite | hybrid | street | Map tile style |
showTrail | boolean | false | Draw a polyline of recent positions |
trailLength | number | 50 | Number of trail points to show |
| Device | device | — | The device to read from |
| Pin | V0–V255 | — | The virtual pin for GPS data |
| Label | string | — | Widget label |
Sending GPS from firmware
The Map widget expects a comma-separated string "lat,lng" or a JSON object:
String format (simplest)
#include <TinyGPS++.h>
void loop() {
Vwire.run();
while (gpsSerial.available())
gps.encode(gpsSerial.read());
if (gps.location.isUpdated()) {
char buf[32];
snprintf(buf, sizeof(buf), "%.6f,%.6f",
gps.location.lat(), gps.location.lng());
Vwire.virtualSend(V0, buf); // "48.858844,2.294351"
}
}
JSON format (with extra fields)
char buf[128];
snprintf(buf, sizeof(buf),
"{\"lat\":%.6f,\"lng\":%.6f,\"speed\":%.1f,\"alt\":%.1f}",
lat, lng, speedKmh, altMeters);
Vwire.virtualSend(V0, buf);
Trail mode
Enable showTrail to draw a line connecting the device's last N positions. Useful for:
- Visualizing a delivery route
- Reviewing a flight path
- Checking if a vehicle deviated from expected path
Trail points come from the time-series DB — historical positions are shown even after a page reload.
Tips
Update rate
GPS fixes typically update once per second. Updating VWire at ~1–5 second intervals is sufficient and conserves bandwidth and battery.
Accuracy
Consumer GPS modules have ±3–10 m accuracy. Use the marker for general tracking only; do not rely on pixel-perfect positioning.