Overview of attribute and spatial queries
The QueryTask
is no exception. It involves working with a series of objects to provide input to the task, execute the task, and dealing with the returned results. The input parameters for an attribute or spatial query are stored in a Query
object that describes the nature of the query you want to perform. The QueryTask
object executes the task using the information provided in the Query
object. The results are returned in the form of a FeatureSet
object. This contains an array of Graphic
features which you can then display on the map.
The Query
object, used as input to a QueryTask
, contains properties including geometry
, where
, and text
.
The geometry
property is used to provide a geometry to use for a spatial query and is either a point, line, or polygon.
The where
property is used to define an attribute query while the text
property is used to perform a SQL WHERE field_name LIKE value
query.
Other Query
object properties include the ability to subset...