Map
Who it’s for
Anyone whose entities have positions that matter — a fleet of vehicles, sensors across a city, assets on a site, equipment spread over a region. The question is spatial: which of these is where, what is near what, and which ones are somewhere they should not be.
What it does
The Map plots entities at their coordinates on a tiled map, with markers, labels and tooltips built from their own data. A device reporting latitude and longitude appears as a marker labelled ${entityName}, and clicking it opens a tooltip showing its coordinates and any additional keys the marker carries.
- Markers carry data, not just position — labels and tooltips are patterns over the entity’s keys, so a marker can show its temperature, its status or its last update alongside its name.
- Several layer types on one map: markers, polygons, circles, polylines and trips, each with its own datasource and styling.
- Marker appearance can follow the data, which is how a fleet map shows which vehicles are in alarm without anyone opening a tooltip.
- Any tile provider — the bundled ones or a server of your own, which matters where an installation cannot reach the public internet.
- Additional datasources supply values for overlay functions from entities that are not themselves drawn on the map.
- Map controls, zoom, scale, default center and a marker-fitting option are all configurable, and an entity load limit keeps a large fleet manageable.
- The Map plots current positions: an entity’s path over time belongs on the Route Map or the Trip Map.
How to set up
Data keys
The Map takes a position per entity from the keys named in each layer’s configuration.
| Key | Role | Type | Description |
|---|---|---|---|
latitude | The marker’s north-south position | Timeseries | Attributes work equally well and are the usual choice for fixed assets. The key name is configured per layer, so any naming scheme works. |
longitude | The marker’s east-west position | Timeseries | As above. An entity missing either key is not drawn, silently. |
| Additional keys | Values used in labels and tooltips | Timeseries | Any keys the marker’s label or tooltip patterns reference, such as temperature. |
Layers
| Setting | Default | Effect |
|---|---|---|
| Map type | Map | A tiled geographic map; Image switches to the Image Map behavior |
| Markers | One demo layer | Entities drawn as markers, with label, tooltip and appearance settings |
| Polygons / Circles / Polylines | Empty | Areas and lines drawn from entity data |
| Fit map bounds to cover all markers | On | Zooms to include every marker on load |
| Default map center position | Configured | Where the map opens when not fitting bounds |
| Limit of entities to load | Configured | Caps how many entities are fetched |
Point the layer at the keys your entities actually publish. An entity with no coordinates is simply absent from the map rather than flagged, so a half-empty map usually means a key name mismatch rather than missing devices.
How to customize
- To show status on the map itself — set the marker appearance to follow a key, so state is visible without opening tooltips.
- To say more in a tooltip — edit the tooltip pattern, which accepts entity variables and any additional key with a decimal specifier such as
${latitude:7}. - To draw zones — add a Polygons or Circles layer bound to the entities that define them.
- To use your own tiles — configure a custom tile provider, which is necessary on installations without internet access.
- To control the opening view — turn off Fit map bounds and set the Default map center position and zoom level.
- To keep a large fleet responsive — lower the Limit of entities to load.
- To bring in values from elsewhere — add Additional datasources for entities that feed overlay functions without being drawn.
Tips
- Put the one fact that decides action into the marker’s appearance rather than its tooltip. A map is scanned, not read, and a status that requires a click to see is a status nobody checks until they already suspect a problem.
- Set an entity load limit before pointing this at a large fleet. The map fetches what the alias returns, and a thousand markers renders slowly and communicates less than a hundred does.
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.