new Workspace()
工作空间是用户的工作环境,主要完成数据的组织和管理,包括打开、关闭、创建、保存工作空间文件(SXW,SMW,SXWU,SMWU,DEFAULT)。工作空间 Workspace 是 SuperMap 中的一个重要的概念,工作空间存储了一个工程项目(同一个事务过程)中所有的数据源,地图的组织关系,工作空间通过其中的数据源集合对象 Datasources ,地图集合对象 Maps 来管理其下的数据源,地图。
Properties:
| Name | Type | Description |
|---|---|---|
DEFAULT |
number | 默认SMWU类型。 |
SMWU |
number | SMWU工作空间,文件型工作空间。 |
SXWU |
number | SXWU工作空间。 |
UDB |
number | 数据库类型。 |
- Source:
Methods
(static) clearMap()
清空所有地图
- Source:
(static) closeAllDatasource()
关闭所有数据集
- Source:
(static) closeDatasource(datasourceName) → {Promise.<boolean>}
关闭指定名称的数据集
Parameters:
| Name | Type | Description |
|---|---|---|
datasourceName |
数据集名称 |
- Source:
Returns:
- Type
- Promise.<boolean>
(static) closeWorkspace() → {boolean}
关闭工作空间
- Source:
Returns:
- Type
- boolean
(static) createDatasource(filePath, engineType) → {Promise.<Datasource>}
创建数据集
Parameters:
| Name | Type | Description |
|---|---|---|
filePath |
指定创建数据集路径 | |
engineType |
数据集引擎类型 |
- Source:
Returns:
- Type
- Promise.<Datasource>
(static) createObj() → {Promise.<Workspace>}
创建workspace实例
- Source:
Returns:
- Type
- Promise.<Workspace>
(static) getDatasources() → {Promise.<Datasources>}
获得数据源集合
- Deprecated:
- Workspace.js:getDatasources() function has been deprecated. If you want to get datasource , please call the getDatasource() function
- Source:
Returns:
- Type
- Promise.<Datasources>
(static) getMapName(mapIndex) → {string}
根据地图序号获得地图名称
Parameters:
| Name | Type | Description |
|---|---|---|
mapIndex |
number |
- Source:
Returns:
- Type
- string
(static) getMaps() → {Promise.<Maps>}
获取工作空间下的Maps对象
- Deprecated:
- Maps类已不推荐使用
- Source:
Returns:
- Type
- Promise.<Maps>
(static) getSceneName(index)
获取三维场景名称
Parameters:
| Name | Type | Description |
|---|---|---|
index |
- Source:
(static) open(workspaceConnectionInfo, passWord) → {Promise.<void>}
根据定义好的工作空间连接信息对象,打开工作空间。
Parameters:
| Name | Type | Description |
|---|---|---|
workspaceConnectionInfo |
object | |
passWord |
string | 数据源密码(可选参数) |
- Source:
Returns:
- Type
- Promise.<void>
(static) openDatasource(jsonObject) → {Promise.<datasource>}
打开数据源 jsonObject 获取网络数据源
Parameters:
| Name | Type | Description |
|---|---|---|
jsonObject |
object | {engineType: |
- Source:
Returns:
- Type
- Promise.<datasource>
(static) removeMap(mapName) → {boolean}
移除地图
Parameters:
| Name | Type | Description |
|---|---|---|
mapName |
- Source:
Returns:
- Type
- boolean
(static) saveWorkspace(server) → {boolean}
保存工作空间
Parameters:
| Name | Type | Description |
|---|---|---|
server |
string | 另存url(可选参数) |
- Source:
Returns:
- Type
- boolean