Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/developer-guide/working-on-maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ For configuring the geocode URL and setting up a self-hosted Nominatim instance,

The `<or-map>` 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 <!-- should be lit or js-templates if it existed/worked -->
<or-map id="map" class="or-map"
showGeoCodingControl
@or-map-geocoder-change="${(ev: OrMapGeocoderChangeEvent) => {
Expand All @@ -80,7 +80,7 @@ The `<or-map>` web component has a `showGeoCodingControl` boolean property (defa

To enable geocoding in your own component:

```html
```javascript <!-- should be lit or js-templates if it existed/worked -->
<or-map
.showGeoCodingControl="${true}"
@or-map-geocoder-change="${(ev) => {
Expand Down
105 changes: 104 additions & 1 deletion docs/user-guide/manager-ui/appearance.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,67 @@ By default Superusers (e.g. the 'admin' user of the master realm) will see these
]
}
}
}
},
"clustering": {
"cluster": true,
"clusterRadius": 180,
"clusterMaxZoom": 17
},
"filters": [
{
"query": {
"types": [
"SoilSensorAsset"
]
}
},
{
"query": {
"types": [
"HarvestRobotAsset"
],
"attributes": {
"items": [
{
"name": {
"predicateType": "string",
"value": "vegetableType"
},
"value": {
"predicateType": "string",
"value": "TOMATO"
}
}
]
}
}
},
{
"label": "Robot & Irrigation errors",
"query": {
"types": [
"HarvestRobotAsset",
"IrrigationAsset"
],
"attributes": {
"items": [
{
"name": {
"predicateType": "string",
"value": "notes"
},
"value": {
"predicateType": "string",
"value": "error",
"match": "CONTAINS",
"caseSensitive": false
}
}
]
}
}
}
]
},
"rules": {
"rules": {
Expand Down Expand Up @@ -544,6 +604,49 @@ 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can reference the AssetQuery somehow? Reference to the class in the code? Something better maybe?

Also we also include an example of a default filter and a filter limited to a specific realm.

```json
{
"pages": {
"map": {
"filters": [
{
"query": { "types": ["SoilSensorAsset"] }
},
{
"query": {
"types": ["HarvestRobotAsset"],
"attributes": {
"items": [
{
"name": { "predicateType": "string", "value": "vegetableType" },
"value": { "predicateType": "string", "value": "TOMATO" }
}
]
}
}
},
{
"label": "Robot & Irrigation errors",
"query": {
"types": ["HarvestRobotAsset", "IrrigationAsset"],
"attributes": {
"items": [
{
"name": { "predicateType": "string", "value": "notes" },
"value": { "predicateType": "string", "value": "error", "match": "CONTAINS", "caseSensitive": false }
}
]
}
}
}
]
}
}
}
```

## Map Settings

If you want to adjust the map styling. You can change the map under Map Settings. Here you have the following options:
Expand Down