Parameters to clear the event states of a collection of shown features.
It clears several features at once, more efficiently than clearing each one.
// 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 it to false only to keep changing features before showing them. This can speed up batch updates.
true Copy
true
The event states to clear.
By default, all event states are cleared from all features.
// Clear only click statesstates: ['click']// Clear the hover and long-hover statesstates: ['hover', 'long-hover']// Clear everything (same as omitting)states: ['click', 'contextmenu', 'hover', 'hover-move', 'long-hover', 'recently-hovered'] Copy
// Clear only click statesstates: ['click']// Clear the hover and long-hover statesstates: ['hover', 'long-hover']// Clear everything (same as omitting)states: ['click', 'contextmenu', 'hover', 'hover-move', 'long-hover', 'recently-hovered']
Parameters to clear the event states of a collection of shown features.
It clears several features at once, more efficiently than clearing each one.
Example