protected void openMap2() {
m_workspace = new Workspace();
m_mapView = findViewById(R.id.map_view);
m_mapControl = m_mapView.getMapControl();
WorkspaceConnectionInfo info = new WorkspaceConnectionInfo();
info.setType(WorkspaceType.SMWU);
info.setServer(rootPath + "/SampleData/GeometryInfo/test.smwu");
m_workspace = new Workspace();
m_workspace.open(info);
m_mapControl.getMap().setWorkspace(m_workspace);
String mapname = m_workspace.getMaps().get(0);//这一行报错
m_mapControl.getMap().open(mapname);
}
报错内容:
Caused by: java.lang.IndexOutOfBoundsException: index
索引越界
at com.supermap.data.Maps.get(Maps.java:81)
at com.luyang.lightsystem.gis.GISMapActivity.openMap2(GISMapActivity.java:110)
at com.luyang.lightsystem.gis.GISMapActivity.onCreate(GISMapActivity.java:38)
at android.app.Activity.performCreate(Activity.java:7893)
at android.app.Activity.performCreate(Activity.java:7880)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)