arcgis android 之图层替换

作者: 奋斗的犇犇 | 来源:发表于2017-09-22 15:49 被阅读146次

上一篇文章简单分享了arcgis for android的一些资料和实现了如何加载集成arcgis到android项目中,今天就简单实现一下,arcgis android 开发中在线图层的替换。很简单几行代码
在布局中引入mapview

  <com.esri.android.map.MapView
        android:id="@+id/arcmap"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#ffffff"/>

初始化并找到mapview组件

MapView mapView= (MapView)view.findViewById(R.id.fgmap)

替换原始图层

     ArcGISTiledMapServiceLayer gg = new
     ArcGISTiledMapServiceLayer("http://60.208.94.143:6080/arcgis/rest/services/sdmap/MapServer");
    mapView.addLayer(gg);
    ArcGISTiledMapServiceLayer 这是arcgis for android 的切片图层服务,是加载最快的图层服务之一,

当然还有很多其他的图层详见上一篇中资料里面的开发教程基础版:如下图

image.png

在底图的基础上覆盖其他图层

   ArcGISDynamicMapServiceLayer TT = new 
   ArcGISDynamicMapServiceLayer("http://60.208.94.143:6080/arcgis/rest/services/LW/LWDHPT/MapServer");
   mapView.addLayer(TT);

本类中的图层服务,是我们公司自己开发的,当然也有很多公用的图层服务比如天地图提供的erc图层,包括地形,影像,交通:
连接:
http://www.tianditu.com/service/query.html

运行效果

image.png

好了,今天就写到这里,以后我再介绍其他arcgis用法。有这方便开发经验的同行们我期待和你们的交流:
qq群:428600570

相关文章

网友评论

    本文标题:arcgis android 之图层替换

    本文链接:https://www.haomeiwen.com/subject/rusfextx.html