Search in sources :

Example 1 with ArcGISLayerInfo

use of com.esri.android.map.ags.ArcGISLayerInfo in project android-gps-test-tool by Esri.

the class GPSTesterActivityController method layerExists.

/**
	 * Returns whether or not a MapType layer has been added or not via <code>addLayer()</code>
	 * @param maptype
	 * @return Boolean confirms the layer exists
	 */
public Boolean layerExists(MapType maptype) {
    Boolean exists = false;
    String layerName = null;
    Layer[] layerArr = _map.getLayers();
    for (Layer layer : layerArr) {
        if (layer instanceof ArcGISTiledMapServiceLayer) {
            ArcGISTiledMapServiceLayer tempMap = (ArcGISTiledMapServiceLayer) layer;
            ArcGISLayerInfo[] info = tempMap.getLayers();
            if (info != null) {
                layerName = info[0].getName().toLowerCase();
                if (layerName.contains("world imagery") && maptype == MapType.SATELLITE) {
                    exists = true;
                    break;
                }
                if (layerName.contains("topographic info") && maptype == MapType.TOPO) {
                    exists = true;
                    break;
                }
                if (layerName.contains("world street map") && maptype == MapType.STREETS) {
                    exists = true;
                    break;
                }
            }
        }
    }
    return exists;
}
Also used : ArcGISTiledMapServiceLayer(com.esri.android.map.ags.ArcGISTiledMapServiceLayer) ArcGISLayerInfo(com.esri.android.map.ags.ArcGISLayerInfo) ArcGISTiledMapServiceLayer(com.esri.android.map.ags.ArcGISTiledMapServiceLayer) GraphicsLayer(com.esri.android.map.GraphicsLayer) Layer(com.esri.android.map.Layer)

Aggregations

GraphicsLayer (com.esri.android.map.GraphicsLayer)1 Layer (com.esri.android.map.Layer)1 ArcGISLayerInfo (com.esri.android.map.ags.ArcGISLayerInfo)1 ArcGISTiledMapServiceLayer (com.esri.android.map.ags.ArcGISTiledMapServiceLayer)1