地图数据已放在手机相关文件夹下,调用帮助文档中的world.smwu已成功运行,但调用TrackData里的地图却报错(引索越界)相关代码如下:
//打开工作空间
m_workspace = new Workspace();
WorkspaceConnectionInfo info = new WorkspaceConnectionInfo();
info.setServer(rootPath + "/SampleData/TrackData/track.smwu");
info.setType(WorkspaceType.SMWU);
m_workspace.open(info);
//将地图显示控件和工作空间关联
m_mapView = (MapView)findViewById(R.id.Map_view);
m_mapcontrol = m_mapView.getMapControl();
m_mapcontrol.getMap().setWorkspace(m_workspace);
//打开工作空间中的第二幅地图
String mapName = m_workspace.getMaps().get(1);
m_mapcontrol.getMap().open(mapName);
m_zoom = (ZoomControls)findViewById(R.id.zoomControls1);
m_mapView = (MapView)findViewById(R.id.Map_view);
m_zoom.setIsZoomInEnabled(true);
m_zoom.setIsZoomOutEnabled(true);