# Class: TileMapServer

## TileMapServer()

#### new TileMapServer()

瓦片地图服务

Source:
  - TileMapServer.js, line 13

### Methods

#### (async, static) createObj() → {Promise.<TileMapServer>}

创建一个新的TileMapServer对象

Source:
  - TileMapServer.js, line 35

##### Returns:

Type
  Promise.<TileMapServer>

#### (async, static) freeTileImage(buf) → {boolean}

释放瓦片图像数据

##### Parameters:

Name | Type | Description
--- | --- | ---
`buf` | Array | 瓦片图像数据

Source:
  - TileMapServer.js, line 326

##### Returns:

成功返回true

Type
  boolean

#### (async, static) getGroundResolution(zoom, dLogY) → {double}

获得缩放级别对应的地面分辨率,与Y值有关（dLogY纬度）

##### Parameters:

Name | Type | Description
--- | --- | ---
`zoom` | int | 瓦片缩放级
`dLogY` | double | 纬度

Source:
  - TileMapServer.js, line 229

##### Returns:

地面分辨率

Type
  double

#### (async, static) getMaxZoom() → {int}

获取最大显示缩放级

Source:
  - TileMapServer.js, line 113

##### Returns:

最大显示缩放级

Type
  int

#### (async, static) getMinZoom() → {int}

获取最小显示缩放级

Source:
  - TileMapServer.js, line 83

##### Returns:

最小显示缩放级

Type
  int

#### (async, static) getScale(zoom, dLogY) → {double}

获取比例尺=图上距离/实地距离，图上距离通过瓦片像素反算成米，实地距离通过地球半径与纬度计算

##### Parameters:

Name | Type | Description
--- | --- | ---
`zoom` | int | 瓦片缩放级
`dLogY` | double | 纬度

Source:
  - TileMapServer.js, line 251

##### Returns:

返回比例尺

Type
  double

#### (async, static) getTileImage(row, col, zoom) → {Array}

根据行列号、缩放级获取瓦片图像

##### Parameters:

Name | Type | Description
--- | --- | ---
`row` | int | 瓦片行索引
`col` | int | 瓦片列索引
`zoom` | int | 瓦片缩放级

Source:
  - TileMapServer.js, line 305

##### Returns:

瓦片图像数据 （int类型的数组）

Type
  Array

#### (async, static) getTileImageByURL(strURL) → {Array}

根据URL获取瓦片图像

##### Parameters:

Name | Type | Description
--- | --- | ---
`strURL` | String | 瓦片图像的URL

Source:
  - TileMapServer.js, line 287

##### Returns:

瓦片图像数据 （int类型的数组）

Type
  Array

#### (async, static) getTileOriginXY() → {Promise.<Dot>}

获取瓦片裁剪原点

Source:
  - TileMapServer.js, line 149

##### Returns:

瓦片裁剪原点

Type
  Promise.<Dot>

#### (async, static) getTileResolution(zoom) → {double}

获得缩放级对应的瓦片分辨率(logic/pixel)

##### Parameters:

Name | Type | Description
--- | --- | ---
`zoom` | int | 瓦片缩放级

Source:
  - TileMapServer.js, line 209

##### Returns:

瓦片分辨率

Type
  double

#### (async, static) getTileSize(width, height) → {boolean}

获得瓦片的高宽大小

##### Parameters:

Name | Type | Description
--- | --- | ---
`width` | Object | 瓦片宽（像素） （Object--IntUser）
`height` | Object | 瓦片高（像素）（Object--IntUser）

Source:
  - TileMapServer.js, line 168

##### Returns:

成功返回true

Type
  boolean

#### (async, static) getZoomCapacity(minZoom, maxZoom) → {boolean}

获取服务数据源缩放级范围

##### Parameters:

Name | Type | Description
--- | --- | ---
`minZoom` | Object | 数据源最小缩放级（Object--IntUser）
`maxZoom` | Object | 数据源最大缩放级（Object--IntUser）

Source:
  - TileMapServer.js, line 130

##### Returns:

成功返回true

Type
  boolean

#### (async, static) setMaxZoom(maxZoom) → {Promise.<Void>}

设置最大显示缩放级

##### Parameters:

Name | Type | Description
--- | --- | ---
`maxZoom` |  | 最大显示缩放级

Source:
  - TileMapServer.js, line 99

##### Returns:

Type
  Promise.<Void>

#### (async, static) setMinZoom(minZoom) → {Promise.<Void>}

设置最小显示缩放级

##### Parameters:

Name | Type | Description
--- | --- | ---
`minZoom` |  | 最小显示缩放级

Source:
  - TileMapServer.js, line 69

##### Returns:

Type
  Promise.<Void>

#### (async, static) setTileResolution(zoom, dResolution) → {int}

设置缩放级对应的瓦片分辨率（logic/pixel）

##### Parameters:

Name | Type | Description
--- | --- | ---
`zoom` | int | 瓦片缩放级
`dResolution` | double | dResolution 瓦片分辨率

Source:
  - TileMapServer.js, line 189

##### Returns:

1-成功；0-失败

Type
  int