Select to view content in your preferred language

querying based on map extent

732
3
03-24-2011 05:56 PM
ArshadAhmed
Emerging Contributor
Hi,

I'm using a QueryTask that takes a Query and it is querying by the geometry. Basically, I have an event listener that listens for extent change of the US topo map and then takes the map extent and gives it as an input to the Query. But I would like to make sure that the map is zoomed atleast to the state level before I execute the query. How can I find out if the map extent is atleast at the state level or lower and then execute the query? I hope this question is clear.

Thank you,
Arshad.
Tags (2)
0 Kudos
3 Replies
FaizanTayyab
Deactivated User
If you know the extent of the state layer, then on each extent change on you can check whether that extent has been reached. If so perform the query.
0 Kudos
ArshadAhmed
Emerging Contributor
I would like to limit the geometry to the size of a state, so that when a user is panning the map on the state border, it would still return the results. The requirement is the limit the geometry of the query to a size, say the size of the state of virginia. Thank you for your time.
0 Kudos
FaizanTayyab
Deactivated User
Have you looked at:

http://resources.esri.com/help/9.3/arcgisserver/apis/flex/apiref/com/esri/ags/tasks/Query.html

especially at the constants. that might be what you are looking for

SPATIAL_REL_CONTAINS constant

public static const SPATIAL_REL_CONTAINS:String = "esriSpatialRelContains"
Part or all of a feature from feature class 1 is contained within a feature from feature class 2.

SPATIAL_REL_CROSSES constant  

public static const SPATIAL_REL_CROSSES:String = "esriSpatialRelCrosses"
The feature from feature class 1 crosses a feature from feature class 2.

SPATIAL_REL_ENVELOPEINTERSECTS constant  

public static const SPATIAL_REL_ENVELOPEINTERSECTS:String = "esriSpatialRelEnvelopeIntersects"
The envelope of feature class 1 intersects with the envelope of feature class 2.

SPATIAL_REL_INDEXINTERSECTS constant  

public static const SPATIAL_REL_INDEXINTERSECTS:String = "esriSpatialRelIndexIntersects"
The envelope of the query feature class intersects the index entry for the target feature class.

SPATIAL_REL_INTERSECTS constant  

public static const SPATIAL_REL_INTERSECTS:String = "esriSpatialRelIntersects"
Part of a feature from feature class 1 is contained in a feature from feature class 2.

SPATIAL_REL_OVERLAPS constant  

public static const SPATIAL_REL_OVERLAPS:String = "esriSpatialRelOverlaps"
Features from feature class 1 overlap features in feature class 2.

SPATIAL_REL_TOUCHES constant  

public static const SPATIAL_REL_TOUCHES:String = "esriSpatialRelTouches"
The feature from feature class 1 touches the border of a feature from feature class 2.

SPATIAL_REL_WITHIN constant  

public static const SPATIAL_REL_WITHIN:String = "esriSpatialRelWithin"
The feature from feature class 1 is completely enclosed by the feature from feature class 2.
0 Kudos