ArcGIS调用离线地图

Cactus_hxk Cactus_hxk 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
想做一个Arcgis调用离线地图用例,可怎么也不行,忘大神们帮帮忙啊,
代码如下:

private MapView mapView = null;
private ArcGISLocalTiledLayer local = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
/*
this.mapView = (MapView)this.findViewById(R.id.map);//设置UI和代码绑定
String strMapUrl="http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineCommunity/MapServer";
ArcGISTiledMapServiceLayer arcGISTiledMapServiceLayer = new ArcGISTiledMapServiceLayer(strMapUrl);
this.mapView.addLayer(arcGISTiledMapServiceLayer);
*/
String pathName = getSDPath()+"/arcgis/neimeng/Layers";
try
{
String inPath = Environment.getExternalStorageDirectory().getPath();
List<String> outPath = getExtSDCardPath();
Log.d("aaaaa","onCreate:++++++++++++++++++"+outPath.size());
for(String s : outPath){
Log.d("aaaaa","onCreate:++++++++++++++++++"+s);
}
Log.d("aaaaa","onCreate: ------------------------------------"+inPath);
File f=new File(pathName);
if(f.exists())
{
Log.d("","onCreate: ------------------------------------"+f.exists());
local = new ArcGISLocalTiledLayer("file://"+pathName);
mapView.addLayer(local);
}

}
catch (Exception e)
{

}

}


执行到这句时就报:local = new ArcGISLocalTiledLayer("file://"+pathName);
报错信息如下:
01-18 16:02:16.795 323-323/com.wd.hellomap D/aaaaa: onCreate:++++++++++++++++++0
01-18 16:02:16.795 323-323/com.wd.hellomap D/aaaaa: onCreate: ------------------------------------/storage/emulated/0

[ 01-18 16:02:16.796 323: 323 D/ ]
onCreate: ------------------------------------true
01-18 16:02:16.809 323-323/com.wd.hellomap E/ArcGIS: url =file:///storage/emulated/0/arcgis/neimeng/Layers
java.lang.RuntimeException: Error reading cache configuration!
at com.esri.android.map.ags.ArcGISLocalTiledLayer.nativeInitialize(Native Method)
at com.esri.android.map.ags.ArcGISLocalTiledLayer.initLayer(Unknown Source)
at com.esri.android.map.ags.ArcGISLocalTiledLayer.<init>(Unknown Source)
at com.esri.android.map.ags.ArcGISLocalTiledLayer.<init>(Unknown Source)
...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部
Cactus_hxk
Android 80,490 成员 91,375 内容