Skip to content

Commit

Permalink
Vector layer docs updated with conditionalStyles
Browse files Browse the repository at this point in the history
This updates documentation for vector/GeoJson layers to include the new "conditionalStyles" attribute.
  • Loading branch information
michaelpnelson authored Feb 14, 2023
1 parent 0a9461f commit db1ef8d
Showing 1 changed file with 33 additions and 0 deletions.
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

0 comments on commit db1ef8d

Please sign in to comment.