java.lang.Object | |||
↳ | com.esri.android.map.Layer | ||
↳ | com.esri.android.map.DynamicLayer | ||
↳ | com.esri.android.map.ags.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);
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ArcGISDynamicMapServiceLayer(String url, int[] visiblelayers)
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.
| |||||||||||
ArcGISDynamicMapServiceLayer(String url, int[] visiblelayers, int[] invisibleLegendLayers, UserCredentials credentials, boolean initLayer)
This constructor is used if you're instantiating the ArcGISDynamicMapServiceLayer.
| |||||||||||
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, UserCredentials credentials)
This constructor is used if you're instantiating the ArcGISDynamicMapServiceLayer.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ArcGISPopupInfo |
createPopupInfo(int sublayerId)
Creates the popup info.
| ||||||||||
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.
| ||||||||||
ArcGISPopupInfo |
getPopupInfo(int sublayerId)
Gets the
PopupInfo associated with the sub-layer id. | ||||||||||
TimeExtent |
getTimeExtent()
Gets the valid TimeExtent object for the Layer or null if this service does not support time based queries.
| ||||||||||
TimeInfo |
getTimeInfo()
Get all the time awareness information for this layer.@return
| ||||||||||
TimeExtent |
getTimeInterval()
Get the current date/time range that this layer is filtered by.
| ||||||||||
Map<Integer, TimeOptions> |
getTimeOptions()
This method will return a list of.
| ||||||||||
boolean |
isTimeAware()
Indicates whether or not this particular layer instance is time aware.
| ||||||||||
boolean |
retrieveLegendInfo()
Supported on ArcGIS Server 10.01 and above.
| ||||||||||
void |
setLayerDefinitions(Map<Integer, String> layerDefs)
Sets the layer definitions used to filter the features of individual layers in the map service.
| ||||||||||
void |
setTimeInterval(TimeExtent timeInterval)
Set the current date/time range that this layer will be filtered by.
| ||||||||||
void |
setTimeOptions(Map<Integer, TimeOptions> timeOptions)
Set a list of LayerTimeOptions.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
byte[] | getImage(int width, int height, Envelope extent) | ||||||||||
void |
initLayer()
Initializes the layer.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
This constructor is used if you're instantiating the ArcGISDynamicMapServiceLayer.
url | the URL of the dynamic map service. |
---|---|
visiblelayers | the IDs of the layers are visible. Set to null if all layers are visible. |
This constructor is used if you're instantiating the ArcGISDynamicMapServiceLayer.
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 service |
initLayer | set to true to initialize the layer. |
This constructor is used if you're instantiating the ArcGISDynamicMapServiceLayer.
url | the URL of the dynamic map service. |
---|---|
visiblelayers | the IDs of the layers are visible. Set to null if all layers are visible. |
invisibleLegendLayers | the IDs of the layers which legends are invisible. Set to null if all layers legend are visible. |
credentials | the credentials used for accessing a secure dynamic map service |
initLayer | set to true to initialize the layer. |
This constructor is used if you're instantiating the ArcGISDynamicMapServiceLayer (see the class description for an example of this usage).
url | the URL of the dynamic map service. |
---|
This constructor is used if you're instantiating the ArcGISDynamicMapServiceLayer.
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 service |
Creates the popup info.
sublayerId | the sublayer id |
---|
Returns the all of sub-layers of the dynamic map service. See getLayers()
if you need the layer returned
in hierarchy.
ArcGISLayerInfo
.Gets the capabilities of the map service. It is a comma separated list of supported capabilities - e.g. "Map, Query, Data". Only available if the map service is published using ArcGIS Server version 10 or greater. You can not call this method until the layer is loaded.
Gets the layer definitions of the ArcGISDynamicMapServiceLayer.
Returns the immediate sub-layers of the dynamic map service. If a layer is a group layer, you can call the
ArcGISLayerInfo
.
getLayers()
method to get the sub-layer of the group layer.Gets the valid TimeExtent object for the Layer or null if this service does not support time based queries.
Get the current date/time range that this layer is filtered by.
This method will return a list of.
Indicates whether or not this particular layer instance is time aware.
Supported on ArcGIS Server 10.01 and above.
Synchronously retrieves the legend information for all the layer infos. Once finished,
getLegend()
may be called on the individual ArcGISLayerInfos that make up this
ArcGISDynamicMapServiceLayer.Sets the layer definitions used to filter the features of individual layers in the map service.
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. |
---|
Set the current date/time range that this layer will be filtered by.
timeInterval | the new date/time range |
---|
Set a list of LayerTimeOptions.
timeOptions | list of LayerTimeOptions to apply to this layer |
---|
Initializes the layer. The implementation should submit the OnStatusChangedListener.STATUS
event accordingly.