|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.android.map.Layer com.esri.android.map.DynamicLayer com.esri.android.map.ags.ArcGISDynamicMapServiceLayer
public class ArcGISDynamicMapServiceLayer
The ArcGISDynamicMapServiceLayer class allows you to work with a dynamic map service resource that is exposed by the ArcGIS Server REST API (see the system requirements document for supported versions of ArcGIS Server). A dynamic map service generates map images on the server each time a request comes in.
The following are examples of how you might work with the ArcGISDynamicMapServiceLayer class. The code will add a map
service from ArcGIS Online using map services that are dynamically retrieved. When working with dynamic services the
ArcGISDynamicMapServiceLayer class must be used. This example code shows you how to connect to ArcGIS Online, but you
can easily update the code to point to your own ArcGIS Server REST end points. Java usage:
//ArcGISDynamicMapServiceLayer class is used to define the Layer that is added to the
//MapView object.
MapView mv = new MapView(this);
mv.addLayer(new ArcGISDynamicMapServiceLayer(
"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer"));
setContentView(mv);
Constructor Summary | |
---|---|
ArcGISDynamicMapServiceLayer(String url)
This constructor is used if you're instantiating the ArcGISDynamicMapServiceLayer (see the class description for an example of this usage). |
|
ArcGISDynamicMapServiceLayer(String url,
int[] visiblelayers)
This constructor is used if you're instantiating the ArcGISDynamicMapServiceLayer. |
|
ArcGISDynamicMapServiceLayer(String url,
int[] visiblelayers,
UserCredentials credentials)
This constructor is used if you're instantiating the ArcGISDynamicMapServiceLayer. |
|
ArcGISDynamicMapServiceLayer(String url,
int[] visiblelayers,
UserCredentials credentials,
boolean initLayer)
This constructor is used if you're instantiating the ArcGISDynamicMapServiceLayer. |
Method Summary | |
---|---|
ArcGISLayerInfo[] |
getAllLayers()
Returns the all of sub-layers of the dynamic map service. |
String |
getCapabilities()
Gets the capabilities of the map service. |
Map<Integer,String> |
getLayerDefinitions()
Gets the layer definitions of the ArcGISDynamicMapServiceLayer. |
ArcGISLayerInfo[] |
getLayers()
Returns the immediate sub-layers of the dynamic map service. |
void |
setLayerDefinitions(Map<Integer,String> layerDefs)
Sets the layer definitions used to filter the features of individual layers in the map service. |
Methods inherited from class com.esri.android.map.DynamicLayer |
---|
cancelPendingTasks, getBrightness, getContrast, getGamma, recycle, refresh, setBrightness, setContrast, setGamma |
Methods inherited from class com.esri.android.map.Layer |
---|
getCredentials, getDefaultSpatialReference, getExtent, getFullExtent, getHeight, getID, getName, getOpacity, getPopupInfo, getResolution, getSpatialReference, getTitle, getUrl, getUrlHashCode, getWidth, isInitialized, isRecycled, isVisible, isWebMapBaselayer, reinitializeLayer, setName, setOnStatusChangedListener, setOpacity, setPopupInfos, setVisible |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArcGISDynamicMapServiceLayer(String url, int[] visiblelayers)
url
- the URL of the dynamic map service.visiblelayers
- the IDs of the layers are visible. Set to null if all layers are visible.public ArcGISDynamicMapServiceLayer(String url, int[] visiblelayers, UserCredentials credentials, boolean initLayer)
url
- the URL of the dynamic map service.visiblelayers
- the IDs of the layers are visible. Set to null if all layers are visible.credentials
- the credentials used for accessing a secure dynamic map serviceinitLayer
- set to true to initialize the layer.public ArcGISDynamicMapServiceLayer(String url)
url
- the URL of the dynamic map service.public ArcGISDynamicMapServiceLayer(String url, int[] visiblelayers, UserCredentials credentials)
url
- the URL of the dynamic map service.visiblelayers
- the IDs of the layers are visible. Set to null if all layers are visible.credentials
- the credentials used for accessing a secure dynamic map serviceMethod Detail |
---|
public String getCapabilities()
public ArcGISLayerInfo[] getLayers()
ArcGISLayerInfo.getLayers()
to get the sub-layer of the group layer.
ArcGISLayerInfo
.public ArcGISLayerInfo[] getAllLayers()
getLayers()
if you need the layer returned
in hierarchy.
ArcGISLayerInfo
.public Map<Integer,String> getLayerDefinitions()
setLayerDefinitions(Map)
public void setLayerDefinitions(Map<Integer,String> layerDefs)
Java sample:
layer = new ArcGISDynamicMapServiceLayer("http://yourhost/MapServer"); HashMap<Integer, String> layerDefs = new HashMap<Integer, String>(); layerDefs.put(Integer.valueOf(1), "pop1990 > 5000000"); layer.setLayerDefinitions(layerDefs); map.addLayer(layer);
layerDefs
- The layerDefs to set. The key is the index of the sublayer, the value is the where clause.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |