diff --git a/docs/developer-guide/working-on-maps.md b/docs/developer-guide/working-on-maps.md index 3cae539..4bf64ff 100644 --- a/docs/developer-guide/working-on-maps.md +++ b/docs/developer-guide/working-on-maps.md @@ -69,7 +69,7 @@ For configuring the geocode URL and setting up a self-hosted Nominatim instance, The `` web component has a `showGeoCodingControl` boolean property (default: `false`) that controls whether the geocoding search box is rendered. In the Manager app (`ui/app/manager/src/pages/page-map.ts`), geocoding is enabled by default: -```html +```javascript 100", + "realms": [ + "smartcity" + ], + "query": { + "types": [ + "EnvironmentSensorAsset" + ], + "attributes": { + "items": [ + { + "name": { + "predicateType": "number", + "value": "ozoneLevel" + }, + "value": { + "predicateType": "number", + "value": 100, + "operator": "GREATER_THAN" + } + } + ] + } + } + }, + { + "label": "Irrigation water flow > 10", + "realms": [ + "manufacturer" + ], + "query": { + "types": [ + "IrrigationAsset" + ], + "attributes": { + "items": [ + { + "name": { + "predicateType": "number", + "value": "flowWater" + }, + "value": { + "predicateType": "number", + "value": 10, + "operator": "GREATER_THAN" + } + } + ] + } + } + } + ] }, "rules": { "rules": { @@ -544,6 +607,75 @@ This configures what asset types are shown as markers on the map. The legend is } ``` +**Map - Preset filters:** +This configures map preset filters, which add a dropdown on the map page to quickly filter the visible assets by type, attribute values, realm, and more using an `AssetQuery`. A live matching-asset count badge is shown per filter option. Options without a `label` will have an auto-derived label based on the type names and attribute values. Selected filters are persisted across page reloads (per user and realm) and reset on each new login session. You can also specify an optional `default` boolean or an array of `realms` to limit where the filter applies. Note that unsupported query fields like `orderBy`, `limit`, and `offset` will result in a warning. +```json +{ + "pages": { + "map": { + "filters": [ + { + "realms": ["manufacturer"], + "query": { "types": ["SoilSensorAsset"] } + }, + { + "label": "CO2 > 100", + "realms": [ + "smartcity" + ], + "query": { + "types": [ + "EnvironmentSensorAsset" + ], + "attributes": { + "items": [ + { + "name": { + "predicateType": "number", + "value": "ozoneLevel" + }, + "value": { + "predicateType": "number", + "value": 100, + "operator": "GREATER_THAN" + } + } + ] + } + } + }, + { + "label": "Irrigation water flow > 10", + "realms": [ + "manufacturer" + ], + "query": { + "types": [ + "IrrigationAsset" + ], + "attributes": { + "items": [ + { + "name": { + "predicateType": "number", + "value": "flowWater" + }, + "value": { + "predicateType": "number", + "value": 10, + "operator": "GREATER_THAN" + } + } + ] + } + } + } + ] + } + } +} +``` + ## Map Settings If you want to adjust the map styling. You can change the map under Map Settings. Here you have the following options: