Arcgis runtime for Android 100.5
2020-07-16 本文已影响0人
_执_念__
在上篇基本用例中,已经说明了如何添加arcgis提供的地图,下面讲一下其他添加地图的方式
1. 添加使用ArcGIS Server 发布的地图服务
//这里的地址可以替换成自己公司发布的地图
val url = "http://map.geoq.cn/arcgis/rest/services/ChinaOnlineCommunity/MapServer"
val arcGISTiledLayer = ArcGISTiledLayer(url)
val arcGISMap = ArcGISMap(Basemap(arcGISTiledLayer))
mapView.map = arcGISMap
2. 添加 WebGIS
WebGIS 提供的Web Map 整合了基础地图和业务图层
val url ="http://map.geoq.cn/arcgis/rest/services/ChinaOnlineCommunity/MapServer";
val arcGISMap = ArcGISMap(url)
mapView.map = arcGISMap
3. 添加在线矢量切片地图
val url ="https://basemaps.arcgis.com/v1/arcgis/rest/services/World_Basemap/VectorTileServer";
val arcGISVectorTiledLayer = ArcGISVectorTiledLayer(url);
val arcGISMap = ArcGISMap(Basemap(arcGISVectorTiledLayer))
mapView.map = arcGISMap
4. 添加离线地图
4.1 离线TPK文件
val path = "文件存储的路径" + "/***.tpk"
val titleCache = TileCache(path)
val arcGISTiledLayer = ArcGISTiledLayer(titleCache)
val basemap = Basemap(arcGISTiledLayer)
val arcGISMap = new ArcGISMap(basemap)
mapView.setMap(arcGISMap)
4.1 矢量切片 VTPK文件
val path = "文件存储的路径" + "/***.vtpk"
val titleCache = TileCache(path)
val arcGISVectorTiledLayer= ArcGISVectorTiledLayer(titleCache)
val basemap = Basemap(arcGISVectorTiledLayer)
val arcGISMap = new ArcGISMap(basemap)
mapView.setMap(arcGISMap)
5. 添加天地图的底图
6. 添加高德地图的底图
7. 底图切换
因为100以后的版本是通过ArcGISMap管理图层的,所以切换的时候直接替换ArcGISMap的basemap就行