Parameters to clear the event states of a collection of shown features.
Bulk operation for removing event states from multiple features at once. More efficient than clearing features individually.
// Remove all event states from all featuresconst clearAll: ClearEventStatesOptions = {};// Remove only click statesconst clearClicks: ClearEventStatesOptions = { states: ['click']};// Remove hover states without renderingconst clearHovers: ClearEventStatesOptions = { states: ['hover', 'long-hover'], show: false}; Copy
// Remove all event states from all featuresconst clearAll: ClearEventStatesOptions = {};// Remove only click statesconst clearClicks: ClearEventStatesOptions = { states: ['click']};// Remove hover states without renderingconst clearHovers: ClearEventStatesOptions = { states: ['hover', 'long-hover'], show: false};
Optional
Whether to show the feature after clearing the event state.
Set to false only if you want to keep manipulating features before showing them, which can improve performance for batch updates.
true Copy
true
The event states to clear.
If not supplied, all event states are cleared from all features.
// Clear only click statesstates: ['click']// Clear all hover-related statesstates: ['hover', 'long-hover']// Clear everything (same as omitting)states: ['click', 'contextmenu', 'hover', 'long-hover'] Copy
// Clear only click statesstates: ['click']// Clear all hover-related statesstates: ['hover', 'long-hover']// Clear everything (same as omitting)states: ['click', 'contextmenu', 'hover', 'long-hover']
Parameters to clear the event states of a collection of shown features.
Bulk operation for removing event states from multiple features at once. More efficient than clearing features individually.
Example