# Class: Graphic

## Graphic()

#### new Graphic()

Source:
  - Graphic.js, line 10

### Methods

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

构造一个新的 Graphic 对象。

Source:
  - Graphic.js, line 19

##### Returns:

Type
  Promise.<Graphic>

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

根据索引获取图形属性名

Source:
  - Graphic.js, line 198

##### Returns:

Type
  Promise.<*>

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

获取图形属性的数目

Source:
  - Graphic.js, line 184

##### Returns:

Type
  Promise.<*>

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

根据属性名称获取图形属性值

##### Parameters:

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

Source:
  - Graphic.js, line 213

##### Returns:

Type
  Promise.<*>

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

获取图形外包矩形

Source:
  - Graphic.js, line 110

##### Returns:

Type
  Promise.<Rect>

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

获取图形中心点坐标

Source:
  - Graphic.js, line 92

##### Returns:

Type
  Promise.<Dot>

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

获取图形的颜色

Source:
  - Graphic.js, line 77

##### Returns:

Type
  Promise.<*>

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

获取图形类型

Source:
  - Graphic.js, line 127

##### Returns:

Type
  Promise.<*>

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

获取覆盖物的可见状态

Source:
  - Graphic.js, line 35

##### Returns:

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

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

获取点是否为像素单位

Source:
  - Graphic.js, line 155

##### Returns:

Type
  Promise.<*>

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

移除指定名称的属性

##### Parameters:

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

Source:
  - Graphic.js, line 228

##### Returns:

Type
  Promise.<void>

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

设置图形的属性

##### Parameters:

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

Source:
  - Graphic.js, line 171

##### Returns:

Type
  Promise.<void>

#### (async, static) setColor(color)

设置图形颜色

##### Parameters:

Name | Type | Description
--- | --- | ---
`color` |  | eg:'rgba(128, 128, 128, 0.5)'

Source:
  - Graphic.js, line 63

#### (async, static) setPointByPixel(pixel) → {Promise.<void>}

设置点是否为像素单位(默认情况下为地图单位)

##### Parameters:

Name | Type | Description
--- | --- | ---
`pixel` |  |

Source:
  - Graphic.js, line 142

##### Returns:

Type
  Promise.<void>

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

设置覆盖物的可见状态

##### Parameters:

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

Source:
  - Graphic.js, line 50