基于 ArcGIS for Android 加载高德/百度/腾讯等切片底图
基于 ArcGIS for Android 加载高德/百度/腾讯等切片底图
使用之前需添加 ArcGIS for Android 依赖:
repositories {
jcenter()
// Add the Esri public Bintray Maven repository
maven {
url 'https://esri.bintray.com/arcgis'
}
}
dependencies {
// Add ArcGIS Runtime SDK for Android dependency
compile 'com.esri.arcgis.android:arcgis-android:10.2.9'
}
排除重复依赖:
packagingOptions {
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
声明权限:
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
更多信息可查看官方文档 : Install and set up—ArcGIS Runtime SDK for Android
添加 arcgis-android-moremap 依赖:
repositories {
jcenter()
}
dependencies {
implementation 'com.wshunli.map:arcgis-android-moremap:1.1.1'
}
更多版本查看 arcgis-android-moremap releases
MapView mMapView = (MapView) findViewById(R.id.map);
mMapView.addLayer(new MoreMapLayer(MoreMapLayerTypes.AMAP_VECTOR));
指定缓存路径即可缓存切片:
MapView mMapView = (MapView) findViewById(R.id.map);
String cachePath = Environment.getExternalStorageDirectory().getAbsoluteFile() + "/MoreMapCache";
MoreMapLayer vec_c = new MoreMapLayer(MoreMapLayerTypes.AMAP_VECTOR, cachePath);
mMapView.addLayer(vec_c);
高德地图
百度地图
腾讯地图
谷歌地图
更多信息查看示例代码 sample
Copyright 2017 wshunli
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.