public class

ArcGISTiledMapServiceLayer

extends TiledServiceLayer
java.lang.Object
   ↳ com.esri.android.map.Layer
     ↳ com.esri.android.map.TiledLayer
       ↳ com.esri.android.map.TiledServiceLayer
         ↳ com.esri.android.map.ags.ArcGISTiledMapServiceLayer

Class Overview

The ArcGISTiledMapServiceLayer class allows you to work with a cached map service resource exposed by the ArcGIS Server REST API. A cached service accesses tiles from a cache instead of dynamically rendering images. Java usage:

 
 MapView mv = new MapView(this);
 mv.addLayer(new ArcGISTiledMapServiceLayer(
 "http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"));
 setContentView(mv);
 
 

Summary

[Expand]
Inherited Constants
From class com.esri.android.map.TiledServiceLayer
[Expand]
Inherited Fields
From class com.esri.android.map.TiledServiceLayer
From class com.esri.android.map.TiledLayer
From class com.esri.android.map.Layer
Public Constructors
ArcGISTiledMapServiceLayer(String url)
This constructor is used if you're instantiating the ArcGISTiledMapServiceLayer using Java code (see the class description for an example of this usage).
ArcGISTiledMapServiceLayer(String url, UserCredentials credentials)
This constructor is used if you're instantiating the ArcGISTiledMapServiceLayer using Java code.
ArcGISTiledMapServiceLayer(String url, UserCredentials credentials, boolean initLayer)
Instantiates an object of ArcGISTiledMapServiceLayer.
Public Methods
Future<ArcGISPopupInfo> createPopupInfo(int sublayerId, CallbackListener<ArcGISPopupInfo> callback)
Asynchronously creates a popup info.
ArcGISPopupInfo createPopupInfo(int sublayerId)
This method is deprecated. since 10.2.4, use createPopupInfo(int, CallbackListener) instead.
Future<LayerServiceInfo> fetchLayerServiceInfo(int sublayerId, CallbackListener<LayerServiceInfo> callback)
Asynchronously fetches the LayerServiceInfo for the specified sublayer.
Future<ArcGISPopupInfo> fetchPopupInfo(int sublayerId, CallbackListener<ArcGISPopupInfo> callback)
Asynchronously fetches the popup info.
ArcGISLayerInfo[] getAllLayers()
Returns the all of sub-layers of the tiled map service.
MapServiceCapabilities getCapabilities()
Gets the capabilities of the map service.
LayerServiceInfo getLayerServiceInfo(int sublayerId)
Return the LayerServiceInfo for the specified sublayer.
ArcGISLayerInfo[] getLayers()
Returns the immediate sub-layers of the tiled map service.
MapServiceInfo getMapServiceInfo()
ArcGISPopupInfo getPopupInfo(int sublayerId)
Gets the PopupInfo associated with the sub-layer id.
final String getQueryUrl(int subLayerId)
Gets the query url.
boolean isExportTilesAllowed()
Returns true if the ArcGIS tile service resource is allowed to download.
boolean retrieveLegendInfo()
Supported on ArcGIS Server 10.01 and above.
Protected Methods
byte[] getTile(int level, int col, int row)
Override this method to implement fetching tiles from a tile service
void initLayer()
Initializes the layer.
void retrieveNoDataTileETag()
[Expand]
Inherited Methods
From class com.esri.android.map.TiledServiceLayer
From class com.esri.android.map.TiledLayer
From class com.esri.android.map.Layer
From class java.lang.Object
From interface com.esri.android.map.popup.PopupLayer

Public Constructors

public ArcGISTiledMapServiceLayer (String url)

This constructor is used if you're instantiating the ArcGISTiledMapServiceLayer using Java code (see the class description for an example of this usage).

Parameters
url String: the URL of the dynamic map service.

public ArcGISTiledMapServiceLayer (String url, UserCredentials credentials)

This constructor is used if you're instantiating the ArcGISTiledMapServiceLayer using Java code.

Parameters
url String: the URL of the tiled map service.
credentials UserCredentials: the credentials used for accessing a secure tiled map service

public ArcGISTiledMapServiceLayer (String url, UserCredentials credentials, boolean initLayer)

Instantiates an object of ArcGISTiledMapServiceLayer.

Parameters
url String: the URL of the tiled map service.
credentials UserCredentials: the credentials used for accessing a secure tiled map service
initLayer boolean: set to true to initialize layer.

Public Methods

public Future<ArcGISPopupInfo> createPopupInfo (int sublayerId, CallbackListener<ArcGISPopupInfo> callback)

Asynchronously creates a popup info. If the popup info already exists and its information is fully populated, then it will simply be returned. If it exists but is missing some information, then a network request will be made to fetch the missing information. If the popup info does not exist, it will be created and then a network request will be made to fetch its full information.

Parameters
sublayerId int: the id of the sublayer for which the popup info should be created
callback CallbackListener: the callback to notify upon completion of creating the popup info
Returns
Future<ArcGISPopupInfo> a Future containing the created popup info.

public ArcGISPopupInfo createPopupInfo (int sublayerId)

This method is deprecated.
since 10.2.4, use createPopupInfo(int, CallbackListener) instead.

Creates the popup info.

Parameters
sublayerId int: the sublayer id
Returns
ArcGISPopupInfo the arc gis popup info

public Future<LayerServiceInfo> fetchLayerServiceInfo (int sublayerId, CallbackListener<LayerServiceInfo> callback)

Asynchronously fetches the LayerServiceInfo for the specified sublayer. If the LayerServiceInfo has already been fetched, then it will simply return that. Otherwise a network request will be made to fetch it. Once it has been fetched, it will be cached so that getLayerServiceInfo(int) will return it, and so that it won't be fetched more than once.

Parameters
sublayerId int: the id of the sublayer for which to get the LayerServiceInfo
callback CallbackListener: the callback to call once the LayerServiceInfo has been retrieved.
Returns
Future<LayerServiceInfo> a Future containing the LayerServiceInfo info for the specified sublayer

public Future<ArcGISPopupInfo> fetchPopupInfo (int sublayerId, CallbackListener<ArcGISPopupInfo> callback)

Asynchronously fetches the popup info. If the popup info exists and its information is fully populated, then it will simply be returned. If it exists but is missing some information, then a network request will be made to fetch the missing information. If the popup info does not exist, then null will be returned

Parameters
sublayerId int: The id of the sublayer for which the popup info should be returned
callback CallbackListener: The callback to notify upon completion of fetching the popup info's full information
Returns
Future<ArcGISPopupInfo> A Future containing the popup info with the fetched full information, or null if there was no popup info.

public ArcGISLayerInfo[] getAllLayers ()

Returns the all of sub-layers of the tiled map service. See getLayers() if you need the layers returned in hierarchy.

Returns
ArcGISLayerInfo[] an array of type ArcGISLayerInfo.

public MapServiceCapabilities getCapabilities ()

Gets the capabilities of the map service. It is an object containing boolean checks against supported operations (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.

Returns
MapServiceCapabilities the map service capabilities or null if the associated server doesn't support it.

public LayerServiceInfo getLayerServiceInfo (int sublayerId)

Return the LayerServiceInfo for the specified sublayer. If the the LayerServiceInfo has not yet been fetched for that sublayer, then null will be returned. To fetch the LayerServiceInfo, see fetchLayerServiceInfo(int, CallbackListener).

Parameters
sublayerId int: the id of the sublayer for which to get the LayerServiceInfo
Returns
LayerServiceInfo the LayerServiceInfo for the specified sublayer

public ArcGISLayerInfo[] getLayers ()

Returns the immediate sub-layers of the tiled map service. If a layer is a group layer, you can call the

Returns
ArcGISLayerInfo[] an array of type ArcGISLayerInfo. getLayers() to get the sub-layers of the group layer.

public MapServiceInfo getMapServiceInfo ()

Returns
MapServiceInfo

public ArcGISPopupInfo getPopupInfo (int sublayerId)

Gets the PopupInfo associated with the sub-layer id.

Parameters
sublayerId int: the sublayer id
Returns
ArcGISPopupInfo PopupInfo

public final String getQueryUrl (int subLayerId)

Gets the query url.

Parameters
subLayerId int: the sub layer id
Returns
String the queryUrl for the sub-layer ID.

public boolean isExportTilesAllowed ()

Returns true if the ArcGIS tile service resource is allowed to download.

Returns
boolean boolean

public boolean retrieveLegendInfo ()

Supported on ArcGIS Server 10.01 and above.
Synchronously retrieves the legend information for all the layer infos. Once finished,

Returns
boolean true, if retrieve legend info getLegend() may be called on the individual ArcGISLayerInfos that make up this ArcGISTiledMapServiceLayer.

Note: The developer is responsible for calling this method in a non-UI thread.

Protected Methods

protected byte[] getTile (int level, int col, int row)

Override this method to implement fetching tiles from a tile service

Parameters
level int: an integer representing the scale level
col int: an integer representing the column
row int: an integer representing the row
Returns
byte[] byte array of tiles
Throws
Exception

protected void initLayer ()

Initializes the layer. The implementation should submit the OnStatusChangedListener.STATUS event accordingly.

protected void retrieveNoDataTileETag ()