// 打开地图 private boolean openMapDizhiyun(){ m_woWorkspace = new Workspace(); // 将地图显示空间和 工作空间关联 m_mapView = (MapView)findViewById(R.id.mapview); m_mapControl = m_mapView.getMapControl(); m_mapControl.getMap().setWorkspace(m_woWorkspace); DatasourceConnectionInfo dsInfo = new DatasourceConnectionInfo(); dsInfo.setAlias("dizhiyun"); dsInfo.setEngineType(EngineType.OGC); //设置驱动名称 dsInfo.setDriver("WMTS"); dsInfo.setServer("https://igss.cgs.gov.cn:6160/igs/rest/ogc/qg150w_20210416_BIwqE0wU/WMTSServer/1.0.0/WMTSCapabilities.xml?tk=eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJnZW9jbG91ZCIsImV4cCI6MTY3NTYxNzU1NX0._dN-7Lb4mbpONsP-kcWWkLTyfsM6RPC10ih3CNqwVKA"); Datasource ds = m_woWorkspace.getDatasources().open(dsInfo); if(ds != null){ m_mapControl.getMap().getLayers().add(ds.getDatasets().get(0), true); m_mapControl.getMap().refresh(); return true; } Log.e(this.getClass().getName(), "打开数据源失败了"); return true; }
截图这是最新截图
这是第二张