m_workspace = new Workspace();
m_mapView = (MapView) findViewById(R.id.mapView);
m_mapControl = m_mapView.getMapControl();
m_mapControl.getMap().setWorkspace(m_workspace);
m_map = m_mapControl.getMap();
ScaleView m_scaleView = (ScaleView) findViewById(R.id.scaleView);
m_scaleView.setMapView(m_mapView);
DatasourceConnectionInfo info = new DatasourceConnectionInfo();
info.setServer(rootPath + "/SuperMap/G620105000XZ20180XX安宁区土地利用现状图/styles/style.json");
info.setEngineType(EngineType.MVTCache);
info.setAlias("MVT");
Datasource datasource = m_workspace.getDatasources().open(info);
if(datasource == null){
return;
}
m_map.getLayers().add(datasource.getDatasets().get(0),true);
Layers layers = m_map.getLayers();
Log.e("名字",layers.get(0).getName());
m_map.setScale(1/2253.218);
m_mapView.syncMap();
m_map.refresh();