<com.esri.android.map.MapView
android:id="@+id/map"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
url="http://www.arcgis.com/home/item.html?id=2b571d8c079d46b4a14a67df42b1da6f"
appId="">
</com.esri.android.map.MapView>
图层是空间数据的载体,通过图层我们可以把地图数据读取到图层中进行显示,在GIS中图层是很重要的概念,图层只有添加到MapView对象中才可以显示加载的地图数据,在ArcGIS Runtime for Android中有许多种图层,不同的图层有不同的作用,下图是图层的关系图:
1、 ArcGISTiledMapServiceLayer
在ArcGIS Server中我们可以发布多种地图服务,移动端需要有不同的图层来对应这些服务。ArcGISTiledMapServiceLayer图层对应ArcGIS Server服务中的切片服务,由于地图服务是切片式的所以它的优势是加载速度快,用法如下:
MapView mv = new MapView(this);
mv.addLayer(new ArcGISTiledMapServiceLayer( "http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"));
setContentView(mv);
2、 ArcGISDynamicMapServiceLayer
ArcGISDynamicMapServiceLayer图层对应ArcGIS Server服务中的动态服务,动态地图服务的地图图像是按照移动设备范围读取的,用法如下:
MapView mv = new MapView(this);
mv.addLayer(new ArcGISDynamicMapServiceLayer( "http://samplese