# Class: GraphicsOverlay

## GraphicsOverlay()

#### new GraphicsOverlay()

Source:
  - GraphicsOverlay.js, line 11

### Methods

#### (async, static) addGraphic(graphic)

添加一个图形

##### Parameters:

Name | Type | Description
--- | --- | ---
`graphic` |  |

Source:
  - GraphicsOverlay.js, line 93

#### (async, static) addGraphics(graphicArray) → {Promise.<void>}

添加一组图形

##### Parameters:

Name | Type | Description
--- | --- | ---
`graphicArray` |  |

Source:
  - GraphicsOverlay.js, line 107

##### Returns:

Type
  Promise.<void>

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

构造一个新的 GraphicsOverlay 对象。

Source:
  - GraphicsOverlay.js, line 20

##### Returns:

Type
  Promise.<GraphicsOverlay>

#### (async, static) getAllGraphics()

返回所有图形

Source:
  - GraphicsOverlay.js, line 160

#### (async, static) getGraphic(index)

获取指定索引的图形

##### Parameters:

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

Source:
  - GraphicsOverlay.js, line 211

#### (async, static) getGraphicCount()

返回所有图形的数目

Source:
  - GraphicsOverlay.js, line 179

#### (async, static) getGraphicsByAttribute(属性名, 属性值)

获取指定属性的图形

##### Parameters:

Name | Type | Description
--- | --- | ---
`属性名` |  |
`属性值` |  |

Source:
  - GraphicsOverlay.js, line 287

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

获取层名称

Source:
  - GraphicsOverlay.js, line 50

##### Returns:

Type
  Promise.<*>

#### (async, static) getState()

获取图形层的可见状态

Source:
  - GraphicsOverlay.js, line 65

##### Returns:

返回层的状态 0 不可见 1 可见

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

获取指定图形的索引

##### Parameters:

Name | Type | Description
--- | --- | ---
`graphic` |  |

Source:
  - GraphicsOverlay.js, line 196

##### Returns:

Type
  Promise.<*>

#### (async, static) insertGraphic(index, graphic) → {Promise.<*>}

插入图形

##### Parameters:

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

Source:
  - GraphicsOverlay.js, line 230

##### Returns:

returnID > 0 插入成功，returnID < 0 插入失败

Type
  Promise.<*>

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

移动图形的叠放次序

##### Parameters:

Name | Type | Description
--- | --- | ---
`fromIndex` |  |
`toIndex` |  |

Source:
  - GraphicsOverlay.js, line 259

#### (async, static) removeAllGraphics()

删除所有图形

Source:
  - GraphicsOverlay.js, line 148

#### (async, static) removeGraphic(index)

删除指定索引的图形

##### Parameters:

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

Source:
  - GraphicsOverlay.js, line 245

#### (async, static) removeGraphic(graphic) → {Promise.<void>}

删除一个图形

##### Parameters:

Name | Type | Description
--- | --- | ---
`graphic` |  |

Source:
  - GraphicsOverlay.js, line 121

##### Returns:

Type
  Promise.<void>

#### (async, static) removeGraphicByAttribute(属性名, 属性值)

删除指定属性的图形

##### Parameters:

Name | Type | Description
--- | --- | ---
`属性名` |  |
`属性值` |  |

Source:
  - GraphicsOverlay.js, line 273

#### (async, static) removeGraphics(graphicArray) → {Promise.<void>}

删除一组图形

##### Parameters:

Name | Type | Description
--- | --- | ---
`graphicArray` |  |

Source:
  - GraphicsOverlay.js, line 135

##### Returns:

Type
  Promise.<void>

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

设置层名称

##### Parameters:

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

Source:
  - GraphicsOverlay.js, line 37

##### Returns:

Type
  Promise.<void>

#### (async, static) setState(state)

设置图形层的可见状态

##### Parameters:

Name | Type | Description
--- | --- | ---
`state` |  |

Source:
  - GraphicsOverlay.js, line 80