离线地图缓存数据损坏

0 投票

试用iDesktop9D制作了紧凑型地图缓存,在移动设备上成功打开了影像;但使用一段时间后部分影像就无法显示了;打开离线地图方式如下:

// 矢量地图
WorkspaceConnectionInfo info3 = new WorkspaceConnectionInfo();
info3.setServer(DefaultDataConfiguration.WorkspacePathMember);
info3.setType(WorkspaceType.SMWU);
if (!m_workspace.open(info3)) {
    showMsg(this.getResources().getString(R.string.data_damage));
    return false;
}
m_mapControl.getMap().open(m_workspace.getMaps().get(0));
// 影像地图
DatasourceConnectionInfo info2 = new DatasourceConnectionInfo();
info2.setServer(DefaultDataConfiguration.WorkspacePathMember1);
info2.setEngineType(EngineType.IMAGEPLUGINS);
Datasource datasource = m_workspace.getDatasources().open(info2);

而且最终datasource会为空指针;这时候查看数据会发现很多.cf文件为0kb

请问是什么原因导致的?

4月 8, 2018 分类:  663次浏览 | 用户: yqtyqt (4 分)

1个回答

0 投票
您好,你是对地图缓存做了什么操作吗
4月 8, 2018 用户: 董懿鑫 名扬四海 (3,422 分)
代码中没有操作,文件改过CacheName属性
你打开这个缓存只是进行了浏览操作吗?你改属性后能不能打开呢
只在应用打开时对影像地图缓存进行了浏览操作,应用中有一些编辑操作都是修改另一个数据源中的矢量图层的。最开始是能够打开的,用一段时间以后就不能打开了,一直报空指针异常
检查一下打开的参数是否有错误,还有调试一下看哈是哪一步报错
打开的参数已经贴上来了,也试过使用EngineType.Rest加载,还是会出现相同的问题。调试过程中只有刚开启应用时会报这个:

04-08 14:42:53.733 14320-14320/com.yunxi.onepicture I/Choreographer: Skipped 61 frames!  The application may be doing too much work on its main thread.
04-08 14:42:53.793 14320-14320/com.yunxi.onepicture E/SurfaceHolder: Exception locking surface
                                                                     java.lang.IllegalArgumentException: Surface was already locked
                                                                         at android.view.Surface.lockCanvas(Surface.java:285)
                                                                         at android.view.SurfaceView$4.internalLockCanvas(SurfaceView.java:852)
                                                                         at android.view.SurfaceView$4.lockCanvas(SurfaceView.java:820)
                                                                         at com.supermap.mapping.MapControl1.c(MapControl1.java:348)
                                                                         at com.supermap.mapping.MapControl1.refreshCallback(MapControl1.java:1043)
                                                                         at com.supermap.mapping.MapControlNative.jni_SetSize(Native Method)
                                                                         at com.supermap.mapping.MapControl1.a(MapControl1.java:1189)
                                                                         at com.supermap.mapping.MapControl1.c(MapControl1.java:358)
                                                                         at com.supermap.mapping.MapControl1$3.surfaceCreated(MapControl1.java:321)
                                                                         at android.view.SurfaceView.updateWindow(SurfaceView.java:606)
                                                                         at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:187)
                                                                         at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944)
                                                                         at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2040)
                                                                         at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1105)
                                                                         at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6189)
                                                                         at android.view.Choreographer$CallbackRecord.run(Choreographer.java:793)
                                                                         at android.view.Choreographer.doCallbacks(Choreographer.java:606)
                                                                         at android.view.Choreographer.doFrame(Choreographer.java:575)
                                                                         at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:779)
                                                                         at android.os.Handler.handleCallback(Handler.java:739)
                                                                         at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                         at android.os.Looper.loop(Looper.java:135)
                                                                         at android.app.ActivityThread.main(ActivityThread.java:5601)
                                                                         at java.lang.reflect.Method.invoke(Native Method)
                                                                         at java.lang.reflect.Method.invoke(Method.java:372)
                                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964)
                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759

之后就一直没有错误。但影像使用一段时间就会无法显示出来,最后整个报空指针
你这个使用一段时间意思是刚开始打开的时候显示出来了,浏览一会就不见了吗?
对,刚开始是正常显示的,用着用着就不见了。。一层一层的消失了。最后干脆直接就是一片白
你i重新切一下地图缓存试一下呢?还有你用的版本是多少的啊
今天重新切了缓存,还是不行。。用的版本是9D
...