Geographical aggregation
The maps module aggregates static GeoJSON declared in geo.maps and can also stream collection-backed and alarm-backed GeoJSON. The Map widget consumes those layers and renders them on a dashboard.
Capabilities
Capability |
Support |
Comment |
|---|---|---|
Display static value-linked layers |
||
Display static alarm-linked layers |
||
Display collection-backed geographical layers |
||
Display alarm-backed geographical layers |
||
Display static or dynamic icons |
See Icons |
|
Support GeoJSON Point, LineString, and Polygon |
See GeoJSON support |
|
Use reserved GeoJSON properties on map features |
||
Set per-feature colors on points and polygons |
Use |
|
Color severity layers automatically from severity |
SEVERITY layers derive colors from the alarm severity palette; per-feature color properties are ignored. See How feature colors are resolved. |
|
Set per-feature colors on lines |
LineString features use a fixed color and width. See Limitations. |
|
Declare STANDARD, SEVERITY, and ICON layers |
||
Populate layers from STATIC sources |
||
Populate layers from COLLECTIONS sources |
||
Populate layers from ALARMS sources |
||
Inherit static GeoJSON hierarchically from |
||
Mix different geometry types inside one layer |
See Limitations |
|
Support GeoJSON polygons with holes |
See Limitations |
|
Geocoding and reverse geocoding to translate between addresses and coordinates |
See Limitations |
|
Expose geographical information through an API |
See Limitations |
Widget capabilities
Capability |
Support |
Comment |
|---|---|---|
Use online map tiles |
Supported with Mapbox tiles (requires a dedicated API token). |
|
Use offline map tiles |
Supported with the Protomaps format for offline access. |
|
Use satellite view |
Supported only with a dedicated Mapbox style (using Mapbox Studio). |
|
Update base map style |
Supported through widget library settings. See Mapbox. |
|
Display static value-linked layers on a map |
The widget renders configured OnSphere layers produced by Geographical aggregation. See Layer controls and user-facing filters. |
|
Display static alarm-linked layers on a map |
The widget renders configured OnSphere layers produced by Geographical aggregation. See Layer controls and user-facing filters. |
|
Display collection-backed geographical layers on a map |
COLLECTIONS layers are rendered through the same map request contract. See Layer controls and user-facing filters. |
|
Display alarm-backed geographical layers on a map |
ALARMS layers are rendered through the same map request contract. See Layer controls and user-facing filters. |
|
Display static or dynamic icons on a map |
Point icons are configured in Geographical aggregation and loaded by the widget. See Icons. |
|
Configure point and polygon colors per feature |
Point and polygon colors are read from feature properties with a default fallback, for static, collection-backed, and alarm-backed STANDARD layers. See How feature colors are resolved. |
|
Color severity layers automatically from alarm severity |
SEVERITY layers are colored from the configured severity palette instead of per-feature properties. See How feature colors are resolved. |
|
Points aggregation (clustering) |
Standard and severity point layers can expose clustering options. See Layer controls and user-facing filters. |
|
Show or hide configured OnSphere layers |
The layer menu can toggle any configured layer. See Layer controls and user-facing filters. |
|
Hide the layer menu through configuration |
Set |
|
Navigate to a dashboard from a displayed map element |
Use the GeoJSON |
|
Load SVG as an map icon |
||
Limit map boundaries and movements |
Configure center, zoom, pitch, bearing, |
|
Switch dynamic collection filters from the map |
The layer menu exposes collection filter ids when a visible layer declares more than one. See Collection and alarm filters. |
|
Switch dynamic alarm filters from the map |
The layer menu exposes alarm filter ids when a visible layer declares more than one. See Collection and alarm filters. |
|
Notify when a selected filter returns no points |
Selecting a collection or alarm filter with an empty result shows a notification without locking the layer. See Collection and alarm filters. |
|
Reuse one floor selector across OnSphere, WMTS, and WMS layers |
Use |
|
WMTS layer support |
Overlay external WMTS raster tiles with templated URLs and runtime parameters. See External raster overlays and parameters. |
|
WMS image support |
Display WMS |
|
Toggle WMS and WMTS sources at runtime |
Each configured external source appears in the layer menu and can be shown or hidden independently. See Runtime source toggles. |
|
WMS / WMTS static parameter settings |
Inject fixed placeholder values into WMS and WMTS templates. See WMS / WMTS template parameters (Static, Dynamic, Shared). |
|
WMS / WMTS dynamic parameter settings |
Expose |
|
WMS / WMTS shared parameter settings |
Reuse one selector value across several WMS and WMTS sources. See WMS / WMTS template parameters (Static, Dynamic, Shared). |
|
Open map menu actions from right click or long press |
Map menus can use the clicked position and feature context. See Map context and Create alarm from map context menu. |
|
Read clicked coordinates, layers, and features in menu context |
The map menu context exposes |
|
Navigate to a specific location on the map from a menu or widget |
Use |
|
Activate or deactivate a specific layer from a menu or widget |
Use |
|
Link to the current map location through the URL |
The widget synchronizes the |
|
Use street view |
||
Update element location on the map |
||
Read live mouse-pointer coordinates |
||
Include the map in a menu (for example as a position picker) |
||
Draw shapes or query an area on the map |
||
Search, measure distance or area, or calculate itineraries |
||
Export the current map view as an image or PDF |
||
Use tiled WMS sources |
||
Use external vector, WFS, or GeoJSON overlay sources |
||
Adapt WMS or WMTS language and theme automatically from the OnSphere theme |
||
Configure WMS or WMTS layers automatically from |
List of configuration files
Filename |
Short description |
Format |
Link to documentation |
|---|---|---|---|
|
Declares static GeoJSON and reserved feature properties. |
json |
|
|
Declares the layer type, geometry type, and |
json |
|
|
Binds the layer to osp-maps. |
json |
|
|
Exposes the layer to osp-web. |
json |
Examples
Short description |
Link to documentation |
|---|---|
Display static value-linked layers |
|
Display static alarm-linked layers |
|
Stream collection-backed geographical layers |
|
Stream alarm-backed geographical layers |
|
Display static and dynamic icons |
|
Reuse one floor selector across static, collection, alarm, and WMTS sources |
GeoJSON support
GeoJSON is the geographic data format used by OnSphere. Static layers read GeoJSON from geo.maps files. COLLECTIONS and ALARMS layers instead read a GeoJSON object from the configured field path of each streamed document or alarm.
Supported geometries
OnSphere supports the following GeoJSON geometries:
Geometry |
Example coordinate types |
Fixed properties |
Description |
|---|---|---|---|
Point |
|
A GeoJSON point. |
|
LineString |
|
Fixed style (see How feature colors are resolved) |
A GeoJSON line string. |
Polygon |
|
A polygon with a single exterior ring. |
Note
Coordinates follow the GeoJSON order [longitude, latitude, altitude?].
Fixed properties for geometries
Inside geo.maps feature properties, the following names are reserved for map-specific behavior:
All color properties listed below are optional. When a STANDARD feature does not set them, the widget falls back to default colors (#084f8d for a point and for a polygon fill, #5ab9d7 for a polygon outline, and 0.25 opacity). SEVERITY layers ignore these color properties and are colored automatically from the alarm severity. For the full color resolution model, see How feature colors are resolved.
Property |
Layers |
Description |
Geometry |
Type |
Example |
|---|---|---|---|---|---|
|
STANDARD, SEVERITY |
Add a label on a point. |
POINT |
Object |
|
|
All |
Add popup name information. |
All |
String |
|
|
All |
Navigate to another dashboard when the user clicks the feature. |
All |
String |
|
|
STANDARD, SEVERITY |
Set the circle color for a given point |
POINT |
String |
|
|
ICON |
Add a static icon image definition. |
POINT |
String |
|
|
ICON |
Rotate the icon image in degrees. |
POINT |
Integer (0 to 360) |
|
|
ICON |
Add a dynamic icon definition. |
POINT |
Object |
|
|
STANDARD, SEVERITY |
Override the fill style (inside color) of a polygon. |
POLYGON |
Object |
|
|
STANDARD, SEVERITY |
Override the outline style (line outside) of a polygon. |
POLYGON |
Object |
|
How feature colors are resolved
Feature colors depend on the layer type.
STANDARD layers (fed by STATIC, COLLECTIONS, or ALARMS sources) read colors from each feature properties:
POINT:
circle-color.POLYGON:
fillandoutline(see Polygon fill and outline).LineString: fixed color and width; per-feature line color is not configurable (see Limitations).
When a color property is omitted, the widget applies the default colors described above (#084f8d fill, #5ab9d7 outline, 0.25 opacity).
SEVERITY layers are colored automatically and ignore circle-color, fill, and outline. The color is derived from the feature severity property, matched against the configured alarm severity palette: each severity defines a background color (point fill, polygon fill, line color) and a foreground color (circle stroke, polygon outline, label text), which can also differ between the light and dark themes. A severity value that is not part of the palette renders transparent. Clustered severity features are colored from highestSeverity.
The severity property is produced by OnSphere, not authored by hand:
for static severity layers, a configured value is copied into
properties.severity(andcount).for alarm-backed severity layers,
highestSeverityis copied intoproperties.severity.
See Alarm-backed layers for alarm-backed and severity layers.
Label
The label property adds a text label to a point feature. Property name is used to show text content; text-anchor and text-color are optional.
The label is rendered above or below the point. text-anchor accepts top or bottom. text-color must be a valid hex color string. The defaults are white text and top anchoring.
"properties": {
"label": {
"name": "Lausanne",
"text-color": "#ffffff",
"text-anchor": "bottom"
}
}
Polygon fill and outline
The fill and outline properties control the visual style of STANDARD polygon features. Both objects are optional, as are their individual fields color and opacity. Any omitted object or field falls back to the default polygon colors (#084f8d fill, #5ab9d7 outline, 0.25 opacity).
color must be a valid hex color string (e.g. "#518D08"). opacity is a float between 0 (fully transparent) and 1 (fully opaque).
When a polygon comes from a COLLECTIONS source, set fill and outline as top-level fields of the collection document, not inside the object that holds the geometry. They are forwarded into the feature properties unchanged (see Collection-backed layers).
"properties": {
"fill": {
"color": "#518D08",
"opacity": 0.5
},
"outline": {
"color": "#79D75A",
"opacity": 0.8
}
}
Layer and source model
To display map data, you typically combine three files:
layer.ospp declares the layer with layerType, valueType, and mapSources.
Layer types
There are three supported layer types:
STANDARD: show geographical information linked with values
SEVERITY: show geographical information linked with alarms
ICON: show static or dynamic icons on geographic points
STANDARD and SEVERITY point layers can also define clustering.
Map source types
Each mapSources entry can be one of the following:
STATIC: link values or alarm severities that inherit their geometry from geo.maps
COLLECTIONS: stream GeoJSON from a collection schema
ALARMS: stream live alarm-backed map data
These are the only valid public values for mapSources[].type. Any previous legacy dynamic source names are obsolete and must not be used.
Below is a static layer example. The same layer id can later be requested by the widget whether the data ultimately comes from geo.maps, a collection stream, or a live alarm stream.
{
"name": "Example points layer",
"description": "",
"layerType": "STANDARD",
"valueType": "POINT",
"mapSources": [
{
"type": "STATIC",
"linkedValues": [
"root.site.bulle.value.variable",
"root.site.lausanne.value.variable"
]
}
]
}
COLLECTIONS sources reference a schema with collectionSource, a GeoJSON field path with geometry, and an optional list of schema filter ids. ALARMS sources reference a GeoJSON field path with geometry, a required alarm view, and a required list of alarm filter ids.
On ICON layers, both COLLECTIONS and ALARMS sources also declare displayRules to decide which announced icon should be displayed for each streamed item.
What the front-end receives
Regardless of the source type, the front-end receives final GeoJSON features already prepared by osp-maps for the current request. That payload is already limited by the selected layer ids, the current bounds when provided, and the optional floor filter applied by the widget.
STATIC: The front-end receives only the final GeoJSON features resolved from geo.maps and linked static values or alarm aggregations. Features outside the current bounds or rejected by floor filtering are not sent.
COLLECTIONS: The widget can activate at most one collection filter per map layer. If the requested filter id is not declared on that source, osp-maps falls back to the first declared filter id. If no filter ids are declared, no override is applied. Each front-end feature is built from one returned collection document only when that document has an id, exposes a valid GeoJSON object at the configured
geometrypath, matches the layer geometry type, is inside the requested bounds, and matches the active floor filter. The GeoJSON field is removed frompropertiesand becomes the final feature geometry. On ICON layers,displayRulesare exposed asproperties.icons.ALARMS: each source declares a fixed alarm
viewand one active alarm filter can be selected per map layer. If the requested filter id is not declared on that source, osp-maps falls back to the first declared filter id. The widget never changes the sourceview. The GeoJSON field is removed frompropertiesand becomes the final feature geometry. On SEVERITY layers,highestSeverityis also copied intoproperties.severity. On ICON layers,displayRulesare exposed asproperties.icons.
Note
To display these layers in a dashboard, use the Map widget.
Static GeoJSON inheritance
At startup, the osp-maps plugin aggregates all the geo.maps files and assigns them hierarchically to the values beneath them.
root
│
├── geo.maps
│
├── folder1
│ ├── geo.maps
│ ├── value.ospp
│ │
│ └── subfolder1
│ └── value.ospp
│
└── folder2
└── value.ospp
In this tree, the geo.maps file in root applies to the value in folder2. The geo.maps file in folder1 applies to the values in folder1 and subfolder1.
Static values and static alarms
For both static value-linked and static alarm-linked layers, the front-end receives only the final GeoJSON features emitted by osp-maps. There is no runtime view selection and no runtime per-layer filter selection for STATIC sources. If a feature falls outside the current request bounds or does not match the active floor filter, it is not sent to the front-end.
Static value-linked layers
Static value-linked layers use a STATIC source and inherit their geometry from geo.maps. This is the standard way to display values that already belong to the OnSphere configuration tree.
Example
Static alarm-linked layers
Static alarm-linked layers also use STATIC sources, but the linked values usually come from alarm aggregations such as ALARM_COUNT or MAX_SEVERITY. The geometry still comes from geo.maps.
Example
Collection-backed layers
COLLECTIONS layers stream live documents from the collections module. Each streamed document must expose a GeoJSON object at the configured geometry path.
The map widget still requests only layer ids. osp-web forwards the current user and osp-maps merges collection-backed features with any other requested layers in the same websocket stream.
At runtime, the widget can activate at most one collection filter per map layer through dynamicCollectionFilters[layerId]. COLLECTIONS sources do not declare any source view. If the requested filter id is not part of mapSources[].filter, osp-maps falls back to the first declared filter id. If the source declares no filter ids, no filter override is applied.
The front-end receives only the documents returned by that effective collection filter after they have been transformed into valid GeoJSON features for the configured layer type. Documents without an id, without a valid GeoJSON object at the configured geometry path, with the wrong geometry type, outside the current bounds, or rejected by the active floor filter are excluded. The geometry field itself is removed from properties and becomes the final feature geometry.
For ICON layers, mapSources[].displayRules replaces the geo.maps icons object. visibleExpression is evaluated against the streamed collection document properties, while existing ${...} placeholders remain available when you need to combine collection fields with subscribed values.
Setting colors from a collection
Set styling properties such as circle-color (points) or fill and outline (polygons) as top-level fields of the collection document, next to your business fields and the geometry object. Every non-geometry field is forwarded verbatim into the feature properties; only the field at the configured geometry path becomes the feature geometry. Do not nest the styling inside the object that holds the geometry — use a top-level fill field, not map.fill.
For example, with geometry set to map.geometry, a collection document that colors a polygon looks like this:
{
"name": "Zone A",
"visibleOnMap": true,
"fill": { "color": "#518D08", "opacity": 0.5 },
"outline": { "color": "#79D75A", "opacity": 0.8 },
"map": {
"geometry": {
"type": "Polygon",
"coordinates": [[[7.05, 46.61], [7.06, 46.62], [7.07, 46.61], [7.05, 46.61]]]
}
}
}
Declare the same styling fields at the top level of the collection schema.ospp, as siblings of name and map:
"properties": {
"name": { "type": "string" },
"fill": {
"type": "object",
"properties": {
"color": { "type": "string" },
"opacity": { "type": "number" }
}
},
"outline": {
"type": "object",
"properties": {
"color": { "type": "string" },
"opacity": { "type": "number" }
}
},
"map": { "type": "object", "properties": { "geometry": { "type": "object" } } }
}
For a point layer, use a single flat circle-color string field instead of the fill and outline objects. Line layers are not affected because their color is fixed (see How feature colors are resolved).
Example
Alarm-backed layers
ALARMS layers stream live alarms directly from osp-alarms. Each source declares:
a GeoJSON field path such as
additionalData.geometryan alarm
viewone or more alarm filter ids
At runtime, the widget can activate at most one alarm filter per map layer through dynamicAlarmFilters[layerId]. The source view always stays the one declared in layer.ospp. If the requested filter id is not part of mapSources[].filter, osp-maps falls back to the first declared filter id.
That source view limits the alarm fields projected by osp-alarms. It must expose the configured geometry field, and a SEVERITY layer view must also expose count. The front-end therefore does not receive the raw full alarm document. It receives only the projected alarm fields returned by the configured view, plus the mandatory live alarm fields always included by osp-alarms, after osp-maps has transformed them into GeoJSON features for the current bounds and floor filter. The configured geometry field is removed from properties and becomes the final feature geometry.
For SEVERITY layers, highestSeverity is also copied into properties.severity so the widget can style the feature consistently. For ICON layers, mapSources[].displayRules becomes properties.icons in the emitted GeoJSON feature, and those rules decide which announced icon must be displayed for each streamed alarm.
Colors follow the layer type. On a SEVERITY layer, the color is derived automatically from properties.severity and the configured alarm severity palette. On a STANDARD layer fed by alarms, colors use circle-color, fill, or outline like any standard layer, but only if the source view projects those fields into the feature properties. See How feature colors are resolved.
Example
Icons
Warning
This feature is currently in beta. It may change in a future version without prior notice. See the Beta Features page for the full list of beta features and their planned release. If you’re using this feature, we encourage you to share your feedback to help with the evaluation process.
Icons can be static or dynamic. In both cases, the icon names must first be announced in the corresponding layer.ospp file.
{
"name": "Icons layer",
"description": "",
"layerType": "ICON",
"valueType": "POINT",
"icons": ["maintenance", "fire", "poi"],
"mapSources": [
{
"type": "STATIC",
"linkedValues": [
"root.site.bulle.value.maintenance",
"root.site.bulle.value.fire",
"root.site.lausanne.value.maintenance",
"root.site.poi"
]
}
]
}
To be usable by the front-end, those icons must also be exposed as assets and announced in Dashboard view and module.resources.
{
"configuration": [
{
"type": "Maps",
"id": "Lo-_-jGf",
"title": "",
"mapsWidgetSettings": {
"layerOptions": [
{
"layerId": "root.layers.icons",
"activatedByDefault": true
},
{
"layerId": "root.layers.points",
"activatedByDefault": true
}
],
"mapStyle": {
"dark": "mapbox://styles/mapbox/dark-v11",
"light": "mapbox://styles/mapbox/light-v11"
},
"icons": [
{
"path": "osp/resources/icons/poi.png",
"name": "poi"
},
{
"path": "osp/resources/icons/fire.png",
"name": "fire"
},
{
"path": "osp/resources/icons/maintenance.png",
"name": "maintenance"
}
],
"iconPriority": [
"fire",
"maintenance",
"poi"
],
"centerPosition": [
7.153656,
46.80603
],
"zoomLevel": 9,
"maxZoom": 25,
"minZoom": 0,
"pitch": 0,
"minPitch": 0,
"maxPitch": 85,
"bearing": 0,
"disableUrlHistory": false
}
},
{
"valueSubscriptions": {
"values": [
{"id": "root.site.bulle.value.fire", "right": "READ_WRITE"},
{"id": "root.site.bulle.value.maintenance", "right": "READ_WRITE"},
{"id": "root.site.lausanne.value.maintenance", "right": "READ_WRITE"}
]
},
"id": "7tGLXFr7",
"type": "ValueSubscription",
"title": ""
}
],
"layout": {
"lg": [
{
"w": 12,
"h": 4,
"x": 0,
"y": 0,
"i": "Lo-_-jGf"
},
{
"w": 12,
"h": 2,
"x": 0,
"y": 4,
"i": "7tGLXFr7"
}
]
},
"breakpoints": {
"lg": 1200,
"md": 996,
"sm": 768,
"xs": 480,
"xxs": 0
},
"cols": {
"lg": 12,
"md": 10,
"sm": 6,
"xs": 4,
"xxs": 2
},
"rowHeight": 150
}
{
"resources": [
{
"destination": "osp/resources/icons/fire.png",
"source": "root/layers/assets/fire.png"
},
{
"destination": "osp/resources/icons/maintenance.png",
"source": "root/layers/assets/maintenance.png"
},
{
"destination": "osp/resources/icons/poi.png",
"source": "root/layers/assets/poi.png"
}
]
}
Static and dynamic icon behavior
Static icons are declared in geo.maps with icon-image. They always show the announced icon on the linked geographic point. icon-rotate can rotate the icon.
Dynamic icons are declared in geo.maps with the icons object. Each key is an icon name and each value can define a visibleExpression and optional overrides such as icon-rotate or linkedDashboard.
{
"geoJsonString": {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [7.0567, 46.6195, 450]
},
"properties": {
"name": "Bulle city",
"label": {"name": "Bulle","text-color": "#F0FFFF", "text-anchor": "bottom"},
"icons": {
"maintenance": {
"visibleExpression": "!!${root.site.bulle.value.maintenance}"
},
"fire": {
"visibleExpression": "!!${root.site.bulle.value.fire}"
}
}
}
},
"moduleId": "modules.maps.maps-1"
}
Evaluation order follows iconPriority in Dashboard view. The first icon whose visibleExpression evaluates to a truthy value is displayed.
visibleExpression is valid JavaScript evaluation. For more information, see dynamic evaluation context.
Example
Limitations
The maps module currently has the following functional limits:
A single layer can only request one geometry type at a time. For example, points and polygons cannot be mixed in the same layer.
GeoJSON polygons with holes are not supported.
LineString features use a fixed color and width; per-feature line color is not configurable. Points and polygons support per-feature colors (see How feature colors are resolved).
Geocoding and reverse geocoding are not supported.
The module does not expose map data through a dedicated public API.