各位大佬,请教下,我使用如下代码加载epsgCode为4524的Geoserver发布的服务,数据源这些都能加载,图层也能加载进去,但是不显示任何内容,将这个服务改成4490之后是可以正常显示图斑内容的。
var datasourceConnectionInfo = DatasourceConnectionInfo()
datasourceConnectionInfo.server ="http://192.168.31.207:8080/geoserver/WSZJD/wms?authkey=xxx&layers=xxxxxxx"
if(mlayer.isOnline){
datasourceConnectionInfo.setEngineType(EngineType.OGC);
datasourceConnectionInfo.setDriver(mlayer.onlineConfig?.driver?:"wmts");
}
else{
datasourceConnectionInfo.engineType = EngineType.IMAGEPLUGINS
}
val datasources: Datasources = mWorkspace!!.datasources
ds = datasources.open(datasourceConnectionInfo)
if (ds != null) {
val dataset=ds.datasets.get(0)
if(mlayer.isOnline) {
dataset.name=mlayer.Name
}
// mMap!!.isDynamicProjection = true
var layer = mMap!!.layers.add(dataset, false)
layer.isVisible = mlayer.isChecked!!
if(mlayer.isOnline){
mMap!!.prjCoordSys=dataset.prjCoordSys
}
layer.isFastDrawEnabled = true
// mMap!!.viewEntire();
}