Workspace m_woWorkspace = new Workspace(); // 将地图显示空间和 工作空间关联 MapControl m_mapControl = mapView.getMapControl(); m_mapControl.getMap().setWorkspace(m_woWorkspace); DatasourceConnectionInfo dsInfo = new DatasourceConnectionInfo(); dsInfo.setServer("http://t0.tianditu.gov.cn/vec_c/wmts?tk=587b02f7d6fb00fe9499441d1c4379fa"); dsInfo.setEngineType(EngineType.OGC); dsInfo.setAlias("天地图"); dsInfo.setDriver("WMTS"); 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 false;