Whether to center the view on the feature after selecting it.
When true, the viewport will be centered on the feature and zoomed to fit the feature
in the viewport. If you need to control the zoom level to prevent it zooming in too
far, you can pass an object with a maxZoom property.
This is useful for avoiding zooming in too far on point features, or if you want
to maintain the current zoom level.
Clears the current selection (elements, features or both).
Use this method to programmatically clear the current selection, which can be useful for resetting the map state or preparing for new selections.
Parameters
Parameter
Type
Description
params?
{ features: boolean; elements: boolean; }
The parameters to clear the selection. If this is not provided, both features and elements will be cleared.
params.features?
boolean
Whether to clear the features from the selection.
Returns
Promise<void>
A promise that resolves when the selection is cleared.
Example
// Removes all features and elements from the selection
felt.clearSelection();
// Removes only features from the selection
felt.clearSelection({ features: true });
// Removes only elements from the selection
felt.clearSelection({ elements: true });