To set the run-time map selection using a query, perform the following steps:
- Create a selection as described in Selecting with the Web API. This creates a feature reader containing the selected features.
- Create an MgSelection object to hold the features in the feature reader.
- Send the selection to the Viewer, along with a call to the Viewer API function SetSelectionXML().