SelectionController
Last updated
Was this helpful?
Last updated
Was this helpful?
The Selection controller allows you to listen for changes to the selection on the map.
getSelection():
Promise
<[]>
Gets the current selection as a list of entity identifiers.
Promise
<[]>
Selects a feature on a layer. This will show the feature's popup, modal or sidebar (if configured) and highlight the feature.
params
Promise
<void
>
clearSelection(
params
?: {features
:boolean
;elements
:boolean
; }):Promise
<void
>
Clears the current selection. This clears the selection of
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.
params.elements
?
boolean
Whether to clear the elements from the selection.
Promise
<void
>
Adds a listener for when the selection changes.
params
params.handler
VoidFunction
A function to unsubscribe from the listener
selectFeature(params
: ): Promise
<void
>
onSelectionChange(params
: { handler
: (change
: { selection
: []; }) => void
; }): VoidFunction
{ handler
: (change
: { selection
: []; }) => void
; }
(change
: { selection
: []; }) => void