# Class: DataBaseSync

## DataBaseSync()

#### new DataBaseSync()

数据库同步编辑

Source:
  - DataBaseSync.js, line 14

### Methods

#### (async, static) commitASync(params, database) → {Promise.<int>}

提交更新(异步执行)

##### Parameters:

Name | Type | Description
--- | --- | ---
`params` | SyncDataBaseParmeters | 异步参数
`database` | DataBase | 数据库

Source:
  - DataBaseSync.js, line 176

##### Returns:

提交同步编号

Type
  Promise.<int>

#### (async, static) createDefaultDownloadDataBaseParmeters(strIGServerBaseURL, strDocName, mapID, extents) → {Promise.<DownloadDataBaseParmeters>}

创建默认的下载数据参数

##### Parameters:

Name | Type | Description
--- | --- | ---
`strIGServerBaseURL` | String | 地图服务基地址
`strDocName` | String | 地图文档名称
`mapID` | int | 地图ID
`extents` | Rect | 范围

Source:
  - DataBaseSync.js, line 56

##### Returns:

下载数据参数

Type
  Promise.<DownloadDataBaseParmeters>

#### (async, static) createDefaultSyncDataBaseParmeters(database) → {Promise.<SyncDataBaseParmeters>}

创建同步的下载数据参数

##### Parameters:

Name | Type | Description
--- | --- | ---
`database` | DataBase | 数据库对象

Source:
  - DataBaseSync.js, line 85

##### Returns:

同步的下载数据参数

Type
  Promise.<SyncDataBaseParmeters>

#### (async, static) downloadASync(strIGServerBaseURL, strDocName, mapID, params, strPath) → {Promise.<int>}

地图下载

##### Parameters:

Name | Type | Description
--- | --- | ---
`strIGServerBaseURL` | String | 地图服务基地址
`strDocName` | String | 地图文档名称
`mapID` | int | 地图ID
`params` | DownloadDataBaseParmeters | 异步参数
`strPath` | String | 全名

Source:
  - DataBaseSync.js, line 131

##### Returns:

下载同步编号

Type
  Promise.<int>

#### (async, static) getMapServiceInfo(strIGServerBaseURL, strDocName, mapIDs) → {Promise.<MapServiceInfo>}

获取地图服务信息

##### Parameters:

Name | Type | Description
--- | --- | ---
`strIGServerBaseURL` | String | 地图服务基地址
`strDocName` | String | 地图文档名称
`mapIDs` | int | 地图ID

Source:
  - DataBaseSync.js, line 106

##### Returns:

地图服务信息

Type
  Promise.<MapServiceInfo>

#### (async, static) stopASync(lSyncCode) → {Promise.<int>}

停止同步

##### Parameters:

Name | Type | Description
--- | --- | ---
`lSyncCode` | int | 同步编号

Source:
  - DataBaseSync.js, line 193

##### Returns:

>0 成功; <=0 失败

Type
  Promise.<int>

#### (async, static) updateASync(params, database) → {Promise.<int>}

更新数据库

##### Parameters:

Name | Type | Description
--- | --- | ---
`params` | SyncDataBaseParmeters | 异步参数
`database` | DataBase | 数据库

Source:
  - DataBaseSync.js, line 158

##### Returns:

更新同步编号

Type
  Promise.<int>