SelectionController


The Selection controller allows you to listen for changes to the selection on the map.

Extended by

Methods

getSelection()

getSelection(): Promise<EntityNode[]>

Gets the current selection as a list of entity identifiers.

Returns

Promise<EntityNode[]>

Example

const selection = await felt.getSelection();

Events

onSelectionChange()

onSelectionChange(params: {handler: (change: {selection: EntityNode[]; }) => void; }): VoidFunction

Adds a listener for when the selection changes.

Parameters

ParameterType

params

object

params.handler

Returns

VoidFunction

A function to unsubscribe from the listener

Example

const unsubscribe = felt.onSelectionChange({
  handler: ({selection}) => console.log(selection),
});

// later on...
unsubscribe();

Last updated