SelectionController
Last updated
Was this helpful?
Was this helpful?
felt.selectFeature({
id: 123,
layerId: "my-layer",
showPopup: true,
fitViewport: { maxZoom: 15 },
});
// 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 });{ features: true, elements: true }const unsubscribe = felt.onSelectionChange({
handler: ({selection}) => console.log(selection),
});
// later on...
unsubscribe();