使用版本
SuperMap iMobile 10i(2020)
代码如下 切换工作空间很慢,请问怎么能优化一下 我想加loading也会把loading卡住
WorkspaceConnectionInfo connectionInfo = new WorkspaceConnectionInfo();
File f = new File(filePath);
String fileName = f.getName();
String prefix = fileName.substring(fileName.lastIndexOf(".") + 1);
if (prefix.compareToIgnoreCase("SMWU") == 0) {
connectionInfo.setType(WorkspaceType.SMWU);
} else if (prefix.compareToIgnoreCase("SXWU") == 0) {
connectionInfo.setType(WorkspaceType.SXWU);
}
connectionInfo.setServer(filePath);
if (m_workspace != null) {
m_mapcontrol.getMap().close();
m_workspace.close();
}
m_workspace.open(connectionInfo);
m_mapcontrol.getMap().setWorkspace(m_workspace);