# Map showing historical values
Widget type: `opendash-widget-leaflet-history` · Plugin: `@opendash/plugin-mobility`

## Description
Visualises historical sensor values on a map over time, showing tracks, timestamps and optionally color coding by value. The widget plots the historical geo positions of the selected data dimension(s) on a Leaflet map. It can render the positions as a connected track (line), as individual points, or as raw geo features, and optionally overlays geographic zones. In line mode, the track can be color-coded by an additional numeric data dimension using configurable value intervals and colors. Clicking a position opens a drawer with details such as the value, its unit, the update time, and the travel time.
## Data requirements
- Data selection: by dimension (`select: "dimension"`), minimum 1 item. Allowed value type: `Geo`.
- Data fetching: live and history are both supported; aggregation is disabled (`aggregation: false`).
## Options
| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `visulization` | `"line" \| "point" \| "raw"` | `"line"` (line preset) / `"raw"` (raw preset) | How positions are drawn: as a connected track ("Geodata as Track"), as individual points, or as raw geo features. |
| `zones` | `GeograhpySelectionType` (optional) | `—` | Optional geographic zones overlaid on the map. Configured via the geography selector (From Datasource / From Zones / External Source GeoJSON). |
| `translationPrefix` | `string` | `"miaas:widgets.historymap.popUp.prefix."` | Translation key prefix used for the labels in the detail pop-up drawer (Value at Position, Unit of value, Time of Value Update, Traveltime). |
| `minDistance` | `number` (line mode, optional) | `0` (line preset) | Minimum distance between consecutive points before a new track segment is drawn. |
| `maxWaitTime` | `number` (line mode, optional) | `300000` (line preset) | Maximum time gap (ms) between points before the track is broken into a new segment. |
| `encoded` | array (line mode, optional) | `[]` | Per-dimension color-coding configuration for the track. Each entry has `key`, a numeric `range` `[min, max]`, `steps` (interval boundaries), `colors` (one per interval), and an optional `data` dimension to color by. Configured in the settings panel: "Optional: Choose a data source that will be color coded on the line", set intervals ("Set intervals") and colors ("Choose colors for intervals"). |
| `zoomOnData` | `boolean` (optional) | `—` | Whether to auto-zoom the map to the data. |
| `hideLayerControls` | `boolean` (optional) | `—` | Hide the Leaflet layer controls. |
| `attribution` | `boolean` (optional) | `—` | Toggle map attribution. |
| `zoomControl` | `boolean` (optional) | `—` | Toggle the zoom control. |
(`onZoneClick`, `onMarkerClick`, `onMap`, and `drawerContent` are programmatic callback/content fields and are not set through the settings UI.)
## Presets
- Geodata as Track — Shows geo values as track. Tags: `map`. Default config: `visulization: "line"`, `encoded: []`, `minDistance: 0`, `maxWaitTime: 300000`, `translationPrefix: "miaas:widgets.historymap.popUp.prefix."`.
- Map showing historical values — Visualises historical sensor values on a map over time, showing tracks, timestamps and optionally color coding by value. Tags: `map`. Default config: `visulization: "raw"`, `translationPrefix: "miaas:widgets.historymap.popUp.prefix."`.
## How to use
1. Add the "Map showing historical values" widget (or the "Geodata as Track" preset) to a dashboard.
2. Select one or more geo data dimensions to display.
3. Choose a time range; the widget plots the historical positions on the map.
4. For the line visualization, optionally pick an additional numeric data source in the settings panel to color-code the track, then set the value intervals and a color per interval.
5. Optionally add a zones overlay via the geography selector.
6. Click a position to open the detail drawer (value, unit, update time, travel time).