Skip to main content

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

PropertyRequiredTypeSummary
targetYesTargetThe target object/identifier used to select feature(s)
actionNostringSelection action to perform: 'add', 'remove', 'replace', 'clear
zoomToExtentNobooleanFlag to zoom to the extent of the selection results
silentNobooleanFlag 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

PropertyRequiredTypeSummary
layerYesstring, number, or FeatureLayerThe ID of the layer to identify
whereNostringA SQL where clause used to select the target feature(s)

Select by object IDs

PropertyRequiredTypeSummary
layerYesstring, number, or FeatureLayerThe ID of the layer to identify
objectIdsNonumber[]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
}
},
'*'
);