Select Event
The select
event provides a mechanism to dynamically and programmatically query/select a feature (or features) and show them in the selection results list. The feature(s) will also be highlighted, as per standard selection behavior, and can optionally be zoomed to.
Properties
Property | Required | Type | Summary |
---|---|---|---|
target | Yes | Target | The target object/identifier used to select feature(s) |
action | No | string | Selection action to perform: 'add', 'remove', 'replace', 'clear |
zoomToExtent | No | boolean | Flag to zoom to the extent of the selection results |
silent | No | boolean | Flag to determine if normal side-effect behavior should apply (ex: expand right menu) |
Target
The target object supports multiple formats for identifying features to select.
Select by query
Property | Required | Type | Summary |
---|---|---|---|
layer | Yes | string, number, or FeatureLayer | The ID of the layer to identify |
where | No | string | A SQL where clause used to select the target feature(s) |
Select by object IDs
Property | Required | Type | Summary |
---|---|---|---|
layer | Yes | string, number, or FeatureLayer | The ID of the layer to identify |
objectIds | No | number[] | Object IDs to use to identify the feature(s) |
Examples
Select using a where clause
postMessage(
{
source: 'SAM',
eventName: 'select',
data: {
target: {
layer: '17e692af3a3-layer-14',
where: "SAP_FLOC_ID='U-E-D-HI-L-O-O-0051067700'"
},
zoomToExtent: true
}
},
'*'
);
Select by object IDs
postMessage(
{
source: 'SAM',
eventName: 'select',
data: {
target: {
layer: '17e692af3a3-layer-14',
objectIds: [1, 2, 3, 4, 5]
},
zoomToExtent: true
}
},
'*'
);