|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.esri.core.tasks.TaskParameters
com.esri.core.tasks.ags.identify.IdentifyParameters
public class IdentifyParameters
The IdentifyParameters class is a container for input parameters that are used during the instantiation of the
IdentifyTask object. The IdentifyTask uses these parameters to perform the action and return the results of the
identify task. See the IdentifyTask class description for more details on what it accomplishes.
This class provides a method, validate(), that will make sure the required parameters have been set with values.
This class also provides a developer with the convenience method generateRequestParams() that will generate a HashMap
of
| Field Summary | |
|---|---|
static int |
ALL_LAYERS
Identify on all layers of the service. |
static int |
TOP_MOST_LAYER
Identify only on the top-most layer of the service. |
static int |
VISIBLE_LAYERS
Identify only on the visible layers of the service. |
| Fields inherited from class com.esri.core.tasks.TaskParameters |
|---|
url |
| Constructor Summary | |
|---|---|
IdentifyParameters()
Default constructor. |
|
IdentifyParameters(String url,
Geometry geometry,
Envelope mapExtent,
SpatialReference extentSR,
int[] layers,
int mapWidth,
int mapHeight,
int dpi)
Constructor with required parameters. |
|
| Method Summary | |
|---|---|
Map<String,String> |
generateRequestParams()
Generates the input parameter used by this class |
int |
getDPI()
Returns the dot-per-inch ratio of the map as it is being displayed. |
Geometry |
getGeometry()
Returns the geometry to be identified. |
int |
getLayerMode()
Returns the mode used by the IdentifyTask to determine which layers to perform the task on. |
int[] |
getLayers()
Returns the array of layer IDs that reference the layers that the IdentifyTask will execute on. |
Envelope |
getMapExtent()
Returns the extent of the map to be identified on |
int |
getMapHeight()
Returns the height of the map in screen pixels. |
int |
getMapWidth()
Returns the width of the map in screen pixels. |
SpatialReference |
getSpatialReference()
Returns the spatial reference of the map extent. |
int |
getTolerance()
|
void |
setDPI(int dpi)
Sets the dot-per-inch ratio of the map (used to determine the resolution of the map). |
void |
setGeometry(Geometry geometry)
Sets the Geometry to be identified. |
void |
setLayerMode(int layerMode)
Sets the mode used by the IdentifyTask to determine which layers to perform the task on. |
void |
setLayers(int[] layers)
Sets The array of layer IDs that reference the layers that the IdentifyTask will execute on. |
void |
setMapExtent(Envelope mapExtent)
Sets the extent of the map to perform the identify in. |
void |
setMapHeight(int mapHeight)
Sets the height in pixels of the extent of the map (used to determine the resolution of the map). |
void |
setMapWidth(int mapWidth)
Sets the width in pixels of the extent of the map (used to determine the resolution of the map). |
void |
setSpatialReference(SpatialReference mapExtentSpatialReference)
Sets the spatial reference of the map extent. |
void |
setTolerance(int tolerance)
Sets the tolerance. |
boolean |
validate()
|
| Methods inherited from class com.esri.core.tasks.TaskParameters |
|---|
equals, getUrl, hashCode, setUrl |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ALL_LAYERS
public static final int VISIBLE_LAYERS
public static final int TOP_MOST_LAYER
| Constructor Detail |
|---|
public IdentifyParameters()
public IdentifyParameters(String url,
Geometry geometry,
Envelope mapExtent,
SpatialReference extentSR,
int[] layers,
int mapWidth,
int mapHeight,
int dpi)
url - the URL of the service to identify ongeometry - the geometry to be identifiedmapExtent - the current extent of the mapextentSR - the spatial reference of the maplayers - the array of layer IDs that reference the layers that the IdentifyTask will execute onmapWidth - the width of the map in pixelsmapHeight - the height of the map in pixelsdpi - the dot-per-inch ratio of the map as it is being displayed on the device| Method Detail |
|---|
public Geometry getGeometry()
public Envelope getMapExtent()
public int[] getLayers()
public int getMapWidth()
public int getMapHeight()
public int getDPI()
public int getLayerMode()
There are 3 possible values:
ALL_LAYERS: identify features on all layers of the serviceVISIBLE_LAYERS: identify features on the visible layers of the service onlyTOP_MOST_LAYER identify features on the top-most layer of the service only
By default the value is ALL_LAYERS.
public int getTolerance()
By default the value is 5. Consider adjusting the tolerance according to the resolution or level of zoom in order to retrieve an accurate number of results. Typically, the tolerance should be small with a low level of zoom (potentially lots of results in a small area of the map) and high on a closer zoom level (results spread out as the zoom level increase).
public void setLayerMode(int layerMode)
There are 3 possible values:
ALL_LAYERS: identify features on all layers of the serviceVISIBLE_LAYERS: identify features on the visible layers of the service onlyTOP_MOST_LAYER identify features on the top-most layer of the service only
By default the value is ALL_LAYERS.
You must carefully consider the following when setting the layer mode because this method's inherent relationship with the setLayers() method of this class. For instance, when you set a layer mode as well as the layer IDs, the ArcGIS Server treats the REST request as a Boolean "AND" operation between options setup with this and the setLayers() methods.
Here is an example to help explain this relationship:
Assume you have set the layer mode to visible so only visible layers are identified by the identify task. At the
same time, let's assume you have called the setLayers() method passing in two layer IDs (2, and 5). However, layers
0, 1, 3 and 4 are all visible layers (6 layers altogether for a map service). When the identify task performs its
operation, then only features on the layers with IDs 2 and 5 are identified, if they are currently visible. It's
possible for layers 0, 1, 3 or 4 to be visible as well, but because of the "AND" condition they do not satisfy the
relationship and features will not be identified on them.
layerMode - the layer mode to set.public void setTolerance(int tolerance)
Sets the tolerance. The tolerance is the acceptable buffer distance, in screen pixels, around the geometry parameter that the IdentifyTask will identify features. The geometry type is specified by using the setGeometry() method or by passing in a geometry object during the instantiation of the IdentifyParameters object.
By default tolerance value is 2.
Example: if the geometry type is defined as an ArcGIS geometry Point and a tolerance of 2 is used, then when a user taps the device any feature that is within 2 pixels of the point created by the tap gesture will be identified.
tolerance - The tolerance to be set.public void setGeometry(Geometry geometry)
Geometry to be identified.
The supported geometries are: Point, Polyline, Polygon and Envelope
geometry - The geometry to be identified.public void setMapExtent(Envelope mapExtent)
mapExtent - The extent of the map.public void setLayers(int[] layers)
Sets The array of layer IDs that reference the layers that the IdentifyTask will execute on.
See the setLayerMode(int) method for details explaining the boolean "AND" relationship between the two
methods when the REST request is sent to the ArcGIS Server to identify features.
layers - The IDs of the layers to perform the identify operation on.public void setMapWidth(int mapWidth)
mapWidth - width of the map.public void setMapHeight(int mapHeight)
mapHeight - height of the map.public void setDPI(int dpi)
dpi - dot-per-inch ratio of the mappublic boolean validate()
validate in class TaskParameterspublic SpatialReference getSpatialReference()
public void setSpatialReference(SpatialReference mapExtentSpatialReference)
mapExtentSpatialReference - the spatial reference of the map extent.public Map<String,String> generateRequestParams()
TaskParameters
generateRequestParams in class TaskParameters
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||