# Class: GraphicPolygon

## GraphicPolygon()

#### new GraphicPolygon()

Source:
  - GraphicPolygon.js, line 11

### Methods

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

构造一个新的 GraphicPolygon 对象。

Source:
  - GraphicPolygon.js, line 32

##### Returns:

Type
  Promise.<GraphicPolygon>

#### (async, static) getArea() → {Promise.<Number>}

获取面积

Source:
  - GraphicPolygon.js, line 48

##### Returns:

Type
  Promise.<Number>

#### (async, static) getBorderlineColor() → {Promise.<String>}

获取边界线的颜色

Source:
  - GraphicPolygon.js, line 202

##### Returns:

颜色。eg:'rgba(128, 128, 128, 128)'

Type
  Promise.<String>

#### (async, static) getBorderlineWidth() → {Promise.<Number>}

获取边界线的宽度

Source:
  - GraphicPolygon.js, line 183

##### Returns:

Type
  Promise.<Number>

#### (async, static) getCirclesToList() → {Promise.<Array>}

获取圈序列

Source:
  - GraphicPolygon.js, line 144

##### Returns:

Type
  Promise.<Array>

#### (async, static) setBorderlineColor(color) → {Promise.<void>}

设置边界线的颜色

##### Parameters:

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

Source:
  - GraphicPolygon.js, line 224

##### Returns:

Type
  Promise.<void>

#### (async, static) setBorderlineWidth(width) → {Promise.<void>}

设置边界线的宽度

##### Parameters:

Name | Type | Description
--- | --- | ---
`width` | Number |

Source:
  - GraphicPolygon.js, line 166

##### Returns:

Type
  Promise.<void>

#### (async, static) setPoints(pointArray, circlesArray) → {Promise.<void>}

设置一组坐标点

##### Parameters:

Name | Type | Description
--- | --- | ---
`pointArray` | Array.<Dot> | 点数组
`circlesArray` | Array.<Number> | 圈序列数组 (int类型的Number)

Source:
  - GraphicPolygon.js, line 69

##### Returns:

Type
  Promise.<void>

#### (async, static) setPointsByDots(dots, circlesArray) → {Promise.<void>}

通过点序列设置一组坐标点

##### Parameters:

Name | Type | Description
--- | --- | ---
`dots` | Dots | 点序列
`circlesArray` | Array.<Number> | 圈序列数组 （int类型的Number）

Source:
  - GraphicPolygon.js, line 115

##### Returns:

Type
  Promise.<void>

##### Example

    let dotArr = [];
           dotArr.push({x: 114.4, y: 30.4});
           dotArr.push({x: 114.44, y: 30.41});
           dotArr.push({x: 114.5, y: 30.5});

           let dotsModule = new Dots();
           let dots = await dotsModule.createObj();
           let circles = [1, 2, 3]; // let circles = null;
           await dots.fromObjectArray(dotArr);
           await this.graphicPolygon.setPointsByDots(dots, null);