highlightStyleFunction
highlightStyleFunction(
styleFn):StyleFunction
Defined in: src/feature-styles.ts:72
Higher-order style function that wraps another style function to add highlight capability.
Applies a blue highlight stroke when the feature has shouldHighlight property set to true.
Parameters
Section titled “Parameters”styleFn
Section titled “styleFn”StyleFunction
The base style function to wrap
Returns
Section titled “Returns”StyleFunction
A new style function that conditionally applies highlighting
Example
Section titled “Example”const baseStyle = (feature) => new Style({ ... })const highlightedStyle = highlightStyleFunction(baseStyle)
const layer = new VectorLayer({ style: highlightedStyle})
// Trigger highlightfeature.set('shouldHighlight', true)