首页 / 浏览问题 / 移动GIS / 问题详情
imobile加载天地图服务不显示
76EXP 2023年05月29日

各位大佬,我使用如下代码加载天地图服务时,能够获取的到数据源,但是地图无法显示,请问这是什么问题呢?

val dcInfo = DatasourceConnectionInfo()
//    打开超图云地图
        //    打开超图云地图
        dcInfo.setEngineType(EngineType.OGC);
        dcInfo.setDriver("WMTS");
        //"http://t0.tianditu.gov.cn/vec_c/wmts?tk=key";
        dcInfo.server = "http://t0.tianditu.gov.cn/vec_c/wmts?tk=mykey"
//    给地图设置工作空间
        //    给地图设置工作空间
        mMapControl.map.workspace = mWorkspace
        val datasource = mWorkspace.datasources.open(dcInfo)
        if (datasource != null) {
//       给地图添加一个图层
           val layer=mMapControl.map.layers.add(datasource.datasets.get(0), true)
            layer.isVisible=true;
            mMapControl.getMap().refresh()
        }
问题关闭原因: imobile端用的key应该是Android平台的key

2 个回答

key也是申请的服务器端的,版本是11i
76EXP 2023年05月29日
加载时会出现如下输出信息:

E/libEGL: eglMakeCurrent:1211 error 3006 (EGL_BAD_CONTEXT)
I/SurfaceView: delay destroy surface control
W/com.xtkj.nczjd: type=1400 audit(0.0:306098): avc: denied { read } for name="/" dev="dm-0" ino=0 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0
W/com.xtkj.nczjd: type=1400 audit(0.0:306099): avc: denied { read } for name="/" dev="dm-0" ino=0 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0
W/com.xtkj.nczjd: type=1400 audit(0.0:306100): avc: denied { read } for name="/" dev="dm-0" ino=0 scontext=u:r:untrusted_app_27:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0
76EXP 2023年05月29日
...