API / geotoolkit / selection / SelectedItem / SelectedItem
selection.SelectedItem.SelectedItem
Base class for selected item, that could be returned via Selector
Throws
Error if sender is not set
| Name | Type |
|---|---|
T | extends WithHitTest = any |
SelectedItem
Constructors
Constructors
• new SelectedItem<T>(sender, data?)
Create selected item
| Name | Type |
|---|---|
T | extends WithHitTest = any |
| Name | Type | Description |
|---|---|---|
sender | T | node that create the item |
Optional data | ReturnType<T["hitTest"]> | some data |
Methods
▸ getClassName(): string
string
▸ getData<U>(A?): ReturnType<U["hitTest"]>
Gets data
Example
import {isSelectedItem} from '@int/geotoolkit/selection/SelectedItem';
const items = Selector.select(root, devicePoint, 3).filter(isSelectedItem);
items.forEach((item) => {
const data = item.getData(LogSinusoid);
if (data) { // it means this SelectedItem came from LogSinusoid
// now inside 'if' typescript knows type of data
data[0].getDepth();
}
});| Name | Type |
|---|---|
U | extends WithHitTest = T |
| Name | Type | Description |
|---|---|---|
Optional A | Constructable<U> | if provided vetify that this SelectedItem came from provided type |
ReturnType<U["hitTest"]>
▸ getSender(): T
Gets sender
T
▸ Static getClassName(): string
string