# Class: Map

## Map()

#### new Map()

地图类，负责地图显示环境的管理。

Source:
  - Map.js, line 10

### Methods

#### (async, static) append(layer) → {Promise.<*>}

添加图层

##### Parameters:

Name | Type | Description
--- | --- | ---
`layer` | Object | 图层

Source:
  - Map.js, line 266

##### Returns:

Type
  Promise.<*>

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

构造一个新的 Map 对象。

Source:
  - Map.js, line 20

##### Returns:

Type
  Promise.<Map>

#### (async, static) dragIn(index, layer)

拽入图层

##### Parameters:

Name | Type | Description
--- | --- | ---
`index` |  | 索引
`layer` |  | 图层

Source:
  - Map.js, line 374

##### Returns:

成功返回1，失败返回0

#### (async, static) dragOut(layer)

移除图层，不会销毁图层

##### Parameters:

Name | Type | Description
--- | --- | ---
`layer` | Object | 图层

Source:
  - Map.js, line 358

##### Returns:

成功返回1，失败返回0

#### (async, static) getDescription() → {Promise.<*>}

获取地图描述

Source:
  - Map.js, line 162

##### Returns:

Type
  Promise.<*>

#### (async, static) getEntireRange() → {Promise.<Rect>}

获取地图范围

Source:
  - Map.js, line 176

##### Returns:

Type
  Promise.<Rect>

#### (async, static) getIsDirty()

获取地图节渲染模式

Source:
  - Map.js, line 251

##### Returns:

返回节点图层数

#### (async, static) getLayer(index) → {Promise.<MapLayer>}

获取图层的名称

##### Parameters:

Name | Type | Description
--- | --- | ---
`index` |  |

Source:
  - Map.js, line 235

##### Returns:

Type
  Promise.<MapLayer>

#### (async, static) getLayerCount()

获取地图节点图层数目

Source:
  - Map.js, line 220

##### Returns:

返回节点图层数

#### (async, static) getMaxScale() → {Promise.<*>}

获取最大显示比

Source:
  - Map.js, line 206

##### Returns:

Type
  Promise.<*>

#### (async, static) getMinScale() → {Promise.<*>}

获取最小显示比

Source:
  - Map.js, line 192

##### Returns:

Type
  Promise.<*>

#### (async, static) getName() → {Promise.<(*|*)>}

获取地图名称

Source:
  - Map.js, line 148

##### Returns:

Type
  Promise.<(*|*)>

#### (async, static) GetRotateAngle() → {Promise.<*>}

获取地图旋转角

Source:
  - Map.js, line 533

##### Returns:

Type
  Promise.<*>

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

获取地图旋转中心

Source:
  - Map.js, line 501

##### Returns:

Type
  Promise.<Dot>

#### (async, static) getViewRange()

获取显示范围

Source:
  - Map.js, line 557

##### Returns:

显示范围

#### (async, static) indexOf(layer)

根据图层查找索引

##### Parameters:

Name | Type | Description
--- | --- | ---
`layer` |  | 图层

Source:
  - Map.js, line 402

##### Returns:

成功返回索引，失败返回-1

#### (async, static) indexOf(name)

根据名称查找图层

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | String | 图层名称

Source:
  - Map.js, line 388

##### Returns:

成功返回索引，失败返回-1

#### (async, static) insert(index, layer) → {Promise.<(*|*|NavigationPreloadState)>}

插入图层

##### Parameters:

Name | Type | Description
--- | --- | ---
`index` |  | 索引
`layer` |  | 图层

Source:
  - Map.js, line 283

##### Returns:

Type
  Promise.<(*|*|NavigationPreloadState)>

#### (async, static) move(fromIndex, toIndex)

将图层从fromIndex移至toIndex

##### Parameters:

Name | Type | Description
--- | --- | ---
`fromIndex` |  | 移动前图层索引
`toIndex` |  | 移动后图层索引

Source:
  - Map.js, line 473

##### Returns:

成功返回true，失败返回false

#### (async, static) moveToBottom(index)

移动图层到最下面（最后绘制）

##### Parameters:

Name | Type | Description
--- | --- | ---
`index` |  | 图层索引

Source:
  - Map.js, line 416

##### Returns:

成功返回true，失败返回false

#### (async, static) moveToDown(index)

下移图层

##### Parameters:

Name | Type | Description
--- | --- | ---
`index` |  | 图层索引

Source:
  - Map.js, line 444

##### Returns:

成功返回true，失败返回false

#### (async, static) moveToTop(index)

移动图层到最上面（最先绘制）

##### Parameters:

Name | Type | Description
--- | --- | ---
`index` |  | 图层索引

Source:
  - Map.js, line 430

##### Returns:

成功返回true，失败返回false

#### (async, static) moveToUp(index)

上移图层

##### Parameters:

Name | Type | Description
--- | --- | ---
`index` |  | 图层索引

Source:
  - Map.js, line 458

##### Returns:

成功返回true，失败返回false

#### (async, static) remove(index)

移除索引为index的图层

##### Parameters:

Name | Type | Description
--- | --- | ---
`index` |  | 图层索引

Source:
  - Map.js, line 329

##### Returns:

成功返回true，失败返回false

#### (async, static) remove(fromIndex, count)

从FromIndex开始移除Count个图层

##### Parameters:

Name | Type | Description
--- | --- | ---
`fromIndex` |  | 开始索引
`count` |  | 移除个数

Source:
  - Map.js, line 314

##### Returns:

成功返回true，失败返回false

#### (async, static) remove(layer) → {Promise.<*>}

移除图层

##### Parameters:

Name | Type | Description
--- | --- | ---
`layer` | Object | 图层

Source:
  - Map.js, line 298

##### Returns:

Type
  Promise.<*>

#### (async, static) removeAll()

移除所有图层，同时销毁图层

Source:
  - Map.js, line 343

##### Returns:

成功返回true，失败返回false

#### (async, static) setDescription(Description) → {Promise.<void>}

设置地图描述信息

##### Parameters:

Name | Type | Description
--- | --- | ---
`Description` | String |

Source:
  - Map.js, line 51

##### Returns:

Type
  Promise.<void>

#### (async, static) setEntireRange(EntireRange) → {Promise.<void>}

设置地图范围

##### Parameters:

Name | Type | Description
--- | --- | ---
`EntireRange` | Object |

Source:
  - Map.js, line 65

##### Returns:

Type
  Promise.<void>

#### (async, static) setFixedScale(scale) → {Promise.<void>}

设置修订后的显示比

##### Parameters:

Name | Type | Description
--- | --- | ---
`scale` | Number |

Source:
  - Map.js, line 121

##### Returns:

Type
  Promise.<void>

#### (async, static) setFixedScalesCount(FixedScalesCount) → {Promise.<void>}

设置修订显示比数目

##### Parameters:

Name | Type | Description
--- | --- | ---
`FixedScalesCount` | Number |

Source:
  - Map.js, line 107

##### Returns:

Type
  Promise.<void>

#### (async, static) setIsCustomEntireRange(IsCustomEntireRange) → {Promise.<void>}

设置地图范围

##### Parameters:

Name | Type | Description
--- | --- | ---
`IsCustomEntireRange` | boolean |

Source:
  - Map.js, line 135

##### Returns:

Type
  Promise.<void>

#### (async, static) setMaxScale(MaxScale) → {Promise.<void>}

设置地图最小大显示比

##### Parameters:

Name | Type | Description
--- | --- | ---
`MaxScale` | Number |

Source:
  - Map.js, line 93

##### Returns:

Type
  Promise.<void>

#### (async, static) setMinScale(MinScale) → {Promise.<void>}

设置地图最小显示比

##### Parameters:

Name | Type | Description
--- | --- | ---
`MinScale` | number |

Source:
  - Map.js, line 79

##### Returns:

Type
  Promise.<void>

#### (async, static) setName(name) → {Promise.<void>}

设置地图名称

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | String |

Source:
  - Map.js, line 37

##### Returns:

Type
  Promise.<void>

#### (async, static) SetRotateAngle(angle) → {Promise.<void>}

设置地图旋转角

##### Parameters:

Name | Type | Description
--- | --- | ---
`angle` |  |

Source:
  - Map.js, line 520

##### Returns:

Type
  Promise.<void>

#### (async, static) SetRotateCenter(center) → {Promise.<void>}

设置地图旋转中心

##### Parameters:

Name | Type | Description
--- | --- | ---
`center` |  |

Source:
  - Map.js, line 488

##### Returns:

Type
  Promise.<void>

#### (async, static) setViewRange()

设置显示范围

Source:
  - Map.js, line 545