问题描述
- ArcGIS for android的一个定位程序打不开本地的tpk文件
-
在网上找的一个Android定位程序,为什么总是打不开本地的tpk地图,,代码如下:public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
map = (MapView) findViewById(R.id.map);local = new ArcGISLocalTiledLayer("file:///sdcard/arcgis/map.tpk"); map.addLayer(local); mLocClient = new LocationClient(getApplicationContext()); mLocClient.registerLocationListener(new BDLocationListenerImpl()); /** * LocationClientOption */ LocationClientOption option = new LocationClientOption(); option.setOpenGps(true); option.setAddrType("all"); option.setCoorType("bd09ll"); option.setPriority(LocationClientOption.GpsFirst); option.setScanSpan(1000); option.disableCache(true); mLocClient.setLocOption(option); gLayerGps = new GraphicsLayer(); map.addLayer(gLayerGps); btnGPS=(Button)findViewById(R.id.btnStartGps); btnGPS.setOnClickListener(new OnClickListener(){ 本人刚刚接触Android开发,求大神指教
解决方案
local=new ArcGISLocalTiledLayer("file:///mnt/sdcard/ArcGIS/Basemap/Layers");
或者local = new ArcGISLocalTiledLayer("file:///storage/sdcard0/ArcGIS/Basemap/Layers")
记得用sdcard时要关掉USB的手机存储
解决方案二:
可以参考以下链接
http://bbs.csdn.net/topics/390479916
时间: 2024-12-04 05:28:43