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;
}
Aggregations