在超图移动端调用,wmts100与wmts-china.
两种的区别是什么。将这两种服务为什么不能与天地图wmts服务一起用?
private boolean openMap(){
m_workspace = new Workspace();
m_mapView = (MapView)findViewById(R.id.Map_view);
m_mapControl = m_mapView.getMapControl();
m_mapControl.getMap().setWorkspace(m_workspace);
DatasourceConnectionInfo dsInfo = new DatasourceConnectionInfo();
DatasourceConnectionInfo dsInfos = new DatasourceConnectionInfo();
DatasourceConnectionInfo dsInfos3 = new DatasourceConnectionInfo();
// dsInfo.setServer("http://220.165.249.18:8099/iserver/services/map-532503MengZiShi/rest/maps/map");
// dsInfo.setEngineType(EngineType.Rest);
// dsInfo.setAlias("ChinaRest");
// dsInfo.setAlias("GoogleMapRoad");
// dsInfo.setEngineType(EngineType.GoogleMaps);
// String url ="http://www.google.cn/maps";
String url3 = "http://220.165.249.18:8099/iserver/services/map-MZS532503/wmts-china";
// dsInfos3.setServer(url3);
// dsInfos3.setAlias("JCTB");
// dsInfos3.setEngineType(EngineType.OGC);
// dsInfos3.setDriver("WMTS");
dsInfos3.setAlias("WMTS1");
dsInfos3.setEngineType(EngineType.OGC);
dsInfos3.setDriver("WMTS");
dsInfos3.setServer(url3);
String url = "http://t0.tianditu.gov.cn/img_c/wmts?tk=493052acd769f94413bb19a27879476b";
dsInfo.setServer(url);
dsInfo.setAlias("TianDiTu1");
dsInfo.setEngineType(EngineType.OGC);
dsInfo.setDriver("WMTS");
String url2 = "http://t0.tianditu.com/cia_c/wmts?tk=493052acd769f94413bb19a27879476b";
dsInfos.setServer(url2);
dsInfos.setAlias("TianDiTu2");
dsInfos.setEngineType(EngineType.OGC);
dsInfos.setDriver("WMTS");
// String url = "http://t0.tianditu.gov.cn/img_c/esri/wmts?tk=493052acd769f94413bb19a27879476b";
// String url = "http://t0.tianditu.gov.cn/img_c/wmts?tk=493052acd769f94413bb19a27879476b";
// dsInfo.setServer(url);
Datasource ds = m_workspace.getDatasources().open(dsInfo);
Datasource ds2 = m_workspace.getDatasources().open(dsInfos);
Datasource ds3 = m_workspace.getDatasources().open(dsInfos3);
Log.e("eeds3",String.valueOf(ds3.getDatasets().getCount()));
Log.e("eeds2",String.valueOf(ds.getDatasets().getCount()));
if(ds3 != null){
Log.e("ee",String.valueOf(ds.getDatasets().getCount()));
m_mapControl.getMap().getLayers().add(ds.getDatasets().get(0), true);
m_mapControl.getMap().getLayers().add(ds3.getDatasets().get(0), true);
m_mapControl.getMap().getLayers().add(ds2.getDatasets().get(0), true);
Point2D mPoint = new Point2D(34645040.2022502,2581504.25122551);
m_mapControl.getMap().setCenter(mPoint);
m_mapControl.getMap().viewEntire();
m_mapControl.getMap().refresh();
return true;
}
Log.e(this.getClass().getName(), "打开数据源失败了");
return true;
}