Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vector layer docs updated with conditionalStyles #208

Merged
merged 1 commit into from
Feb 14, 2023
Merged
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
33 changes: 33 additions & 0 deletions docs/configuration/layers/vector.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Click on a property name for more information:
<a href="#clusteroption-property" >"clusterOption"</a>: null,
<a href="#useheatmap-property" >"useHeatmap"</a>: false,
<a href="#style-property" >"style"</a>: null,
<a href="#conditionalstyles-property" >"conditionalStyles"</a>: null,
<a href="#dataUrl-property" >"dataUrl"</a>: null
} ] }
</pre>
Expand Down Expand Up @@ -68,6 +69,38 @@ The default is `false`.

The [style object](style) used to render the features from this data source.

## ConditionalStyles Property
`"conditionalStyles": Array`

Style attributes applied to features based on feature attribute values. These style attributes override style attributes with the same name in the `style` property.

Each conditional style has a `property`, which is the name of a feature attribute, and `conditions`, an array of objects containing a `value`, which is the value of the `property` attribute, and a `style` object.

In this sample configuration, features having a `Station_Type` value of `Public` will be styled as blue, and features where `Station_Type` is `Private` will be styled as green.

```
"conditionalStyles": [
{
"property": "Station_Type",
"conditions": [
{
"value": "Public",
"style": {
"strokeColor": "#0000ff",
"fillColor": "#0000ff"
}
},
{
"value": "Private",
"style": {
"strokeColor": "#00ff00",
"fillColor": "#00ff00"
}
}
]
}
]
```

## DataUrl Property
`"dataUrl": String`
Expand Down