代码 :
Workspace workspace = new Workspace(); DatasourceConnectionInfo datasourceConnectionInfo = new DatasourceConnectionInfo(); datasourceConnectionInfo.setEngineType(EngineType.Rest); datasourceConnectionInfo.setServer("http://support.supermap.com.cn:8090/iserver/services/map-changchun/rest/maps/长春市区图"); datasourceConnectionInfo.setAlias("长春市区图"); map.setWorkspace(workspace); Datasource datasource = workspace.getDatasources().open(datasourceConnectionInfo); if (datasource != null){ map.getLayers().add(datasource.getDatasets().get(0),false); } Log.e("bigone",datasource.getDatasets().get(0).getBounds() + ""); map.setViewBounds(datasource.getDatasets().get(0).getBounds()); map.setLockedViewBounds(datasource.getDatasets().get(0).getBounds()); // map.setViewBoundsLocked(true); map.setAntialias(true); mapView.refresh();
设置了map.setViewBoundsLocked(true) 之后就会出现上面的情况