ArcReaderControl spatial query


Purpose
This sample demonstrates how to use the IARMap.QueryARFeatures method to search for visible features intersecting a given envelope using IARSearchDef.
 
The SetEnvelopeShape method sets the search geometry of the query to the current visual extent of the focus map, and the SpatialRelationship is set to "intersects." This query definition is passed to the QueryARFeatures method to create an ARFeatureSet. Features are accessed from ARFeatureSet using the Next method and the ARFeature property. The FieldAliasName and Value of each field is displayed in a Microsoft FlexGrid control if the loaded document was published with permission to query values.
 
The ZoomTo, CenterAt, Flash, and Flicker methods are used to identify each feature on the map.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Start Visual Studio, open the solution file, and build the project. The Microsoft FlexGrid control (msflxgrd.ocx) is used in this sample.
  2. Run the application.
  3. Browse to a Published Map File (PMF) from ArcMap to load.
  4. Navigate to some features of interest.
  5. Query the focus map for all visible features within the current map extent.
  6. Loop through the features to display field values, and use the PanTo, ZoomTo, Flash, and Flicker buttons to identify each feature on the map.

SpatialQuery.vb Form file.
AssemblyInfo.vb Assembly information.
Download the VB.NET files
SpatialQuery.cs Form file.
AssemblyInfo.cs Assembly information.
Download the C# files

Download the files for all languages




Development licensing Deployment licensing
ArcView: Publisher ArcReader
ArcEditor: Publisher Engine Runtime
ArcInfo: Publisher ArcView
ArcEditor
ArcInfo