Optionalmode?: "put" | "add"Whether to replace or add to existing event states.
Optionalshow?: booleanWhether to show the feature after updating the event state.
The event state to set.
// Select a feature programmatically
const options: PutEventStateOptions = {
index: 0,
state: 'click',
mode: 'put', // Remove click state from other features
show: true
};
// Add hover state without affecting others
const hoverOptions: PutEventStateOptions = {
index: 2,
state: 'hover',
mode: 'add', // Keep other hover states
show: true
};
Parameters to update the event state of a feature programmatically.
Allows you to manually set event states on features, useful for: