Update location time series
Simple form to input new location for pre-defined time series keys.
Who it’s for
Anyone recording where something was at a point in time — a manual position fix on an asset without GPS, a technician logging where equipment was left, a survey point captured on site. Each entry is a reading with a timestamp rather than a setting that replaces the last one.
What it does
The Update location time series widget presents latitude and longitude fields and writes them to the entity on save. The Get current location button fills both fields from the browser’s own geolocation, which is what makes this practical for a technician standing at the spot with a phone.
- Two fields, one action — coordinates entered or captured together and committed as a pair.
- The current location button removes the transcription step, which is where manual coordinate entry usually goes wrong.
- High accuracy mode can be requested from the browser, trading battery and time for a better fix.
- The key names are configurable, so the widget writes whatever the rest of the dashboard already reads.
- Field labels, their wording, and whether each is required are all configurable.
- Fields lay out in a column or a row, so the form fits a narrow panel or a wide band.
- Written as time series, each submission is a new point rather than an overwrite, which is what lets a trip map or a position history be built from manual entries.
- The Update location time series widget captures a position: it draws no map, so pairing it with a map widget is what lets anyone confirm the point landed where they meant.
How to set up
Data keys
The Update location time series widget writes the two keys named in its settings.
| Attribute | Scope | Operation | Description |
|---|---|---|---|
latitude | Server | Write | The latitude key, named by Latitude key name. Written as telemetry. |
longitude | Server | Write | The longitude key, named by Longitude key name. Written as telemetry. |
Set the key names to match whatever the map widgets on the dashboard already read. The defaults are latitude and longitude, and a mismatch produces a form that saves successfully while the map stays empty.
Form
| Setting | Default | Effect |
|---|---|---|
| Latitude key name | latitude | The key written for latitude |
| Longitude key name | longitude | The key written for longitude |
| Show button ‘Get current location’ | On | Fills both fields from the browser’s geolocation |
| Use high accuracy | Off | Requests a more precise fix, at the cost of time and battery |
| Show label | On | Prints the field captions |
| Input fields alignment | Column | Stacks the fields or places them side by side |
| Latitude field required | On | Blocks saving without a latitude |
| Longitude field required | On | Blocks saving without a longitude |
| Show result message | On | Confirms the write on screen |
How to customize
- To match the dashboard’s existing keys — set the Latitude key name and Longitude key name.
- To get a better fix in the field — turn on Use high accuracy, which is worth the wait when the position is being surveyed.
- To fit a wide band — set Input fields alignment to Row.
- To word the fields — set the Label for latitude and Label for longitude, or turn labels off on a compact panel.
- To allow a partial entry — turn off the required flags, though a half-set position is rarely useful.
- To word the validation — set the ‘Required’ error message to something that says what is missing.
Tips
- Choose the time series form over the attribute one whenever the history matters. An attribute keeps only the current position, so the record of where an asset has been is lost the moment somebody records where it is now.
- Put a map beside the form showing the same keys. A pair of coordinates is unverifiable by reading it, and a point that landed in the wrong hemisphere because of a sign is obvious on a map and invisible in a text field.
Share Your Widget with the Community
Built a custom widget? Export it as a JSON from ThingsBoard and publish it to the IoT Hub through a simple 4-step wizard (Upload, Listing, Readme, Review & Submit). Share it with thousands of ThingsBoard developers worldwide and get featured in the catalog.