Skip to main content

Location Widget

✦ Special

The Location widget works in the opposite direction from the Map widget — instead of displaying location from a device, it collects the user's current GPS position (via the browser Geolocation API) and writes it to a virtual pin that the device can read. Useful for "go to my location" commands on robots, drones, or delivery bots.

Default size: 3 × 3 grid cells


Configuration

PropertyTypeDefaultDescription
showMapbooleantrueRender user position on a mini-map inside the widget
accuracyhigh | lowhighBrowser accuracy hint (enableHighAccuracy)
watchModebooleanfalseContinuously update on position change
DevicedeviceThe device to write to
PinV0V255The virtual pin to write location to
LabelstringWidget label

Output format

When the user clicks Send Location, the widget writes:

"lat,lng,accuracy"

Example:

"48.858844,2.294351,5.3"

Fields: latitude (°), longitude (°), accuracy (metres).


Firmware example: navigate to user

VWIRE_RECEIVE(V0) {
String raw = param.asStr(); // "48.858844,2.294351,5.3"

float lat, lng, acc;
sscanf(raw.c_str(), "%f,%f,%f", &lat, &lng, &acc);

if (acc > 50.0) {
// accuracy too poor, log a warning
Vwire.virtualSend(V0, "LOCATION_POOR_ACCURACY");
return;
}

navigateTo(lat, lng);
Vwire.virtualSend(V0, "NAVIGATING");
}

Watch mode

With watchMode: true, every time the user's device GPS updates (while the dashboard is open), the location is pushed automatically. Use for:

  • Mobile field controllers that keep a robot near the operator
  • Delivery tracking where the delivery person's phone drives a dashboard marker

Permissions

The browser will prompt for location permission on first use. If the user denies, the widget shows a Permission Denied message. This is a browser security constraint — no workaround exists.