各位大佬,我在使用imobile (11i)做移动端开发时,地图用的天地图服务,后面加载本地sci(矢量切片)时开启了动态投影后两个图层无法叠加到一起,且天地图不显示,两个图层我在idesktop上叠加能够叠加在一起,请问这种情况如何解决呢?加载sci的代码如下:
/**
* @Description加载sci影像数据
* @Author rmj
* @Time 2022/1/12 17:46
*/
fun initMap(mLayer: Layer, mWorkspace: Workspace, context: Context) {
try {
var datasourceConnectionInfo = DatasourceConnectionInfo()
datasourceConnectionInfo.server = mLayer.Path
datasourceConnectionInfo.alias="${mLayer.datasetName}"
datasourceConnectionInfo.engineType = EngineType.IMAGEPLUGINS
val datasources: Datasources = mWorkspace!!.datasources
var ds1 = datasources.get(mLayer.datasetName)
if (ds1 != null) return
val ds = datasources.open(datasourceConnectionInfo)
if (ds != null) {
val viewRectangle= mMap!!.viewBounds.clone()
mMap!!.isDynamicProjection=true
var layer = mMap!!.layers.add(ds.datasets.get(0), true)
// mMap!!.setDynamicProjection(true,mMap!!.prjCoordSys)
mMap!!.viewBounds=viewRectangle
layer.setOpaqueRate(100 - mLayer.alpha)
layer.isVisible = mLayer.isChecked!!
}
datasourceConnectionInfo.dispose()
} catch (e: Exception) {
MyLog.e("initMap", "${e.message}", context)
}
}