new GraphicPolygon()
- Source:
Methods
(async, static) createObj() → {Promise.<GraphicPolygon>}
构造一个新的 GraphicPolygon 对象。
- Source:
Returns:
- Type
- Promise.<GraphicPolygon>
(async, static) getArea() → {Promise.<Number>}
获取面积
- Source:
Returns:
- Type
- Promise.<Number>
(async, static) getBorderlineColor() → {Promise.<String>}
获取边界线的颜色
- Source:
Returns:
颜色。eg:'rgba(128, 128, 128, 128)'
- Type
- Promise.<String>
(async, static) getBorderlineWidth() → {Promise.<Number>}
获取边界线的宽度
- Source:
Returns:
- Type
- Promise.<Number>
(async, static) getCirclesToList() → {Promise.<Array>}
获取圈序列
- Source:
Returns:
- Type
- Promise.<Array>
(async, static) setBorderlineColor(color) → {Promise.<void>}
设置边界线的颜色
Parameters:
| Name | Type | Description |
|---|---|---|
color |
String | eg:'rgba(128, 128, 128, 128)' |
- Source:
Returns:
- Type
- Promise.<void>
(async, static) setBorderlineWidth(width) → {Promise.<void>}
设置边界线的宽度
Parameters:
| Name | Type | Description |
|---|---|---|
width |
Number |
- Source:
Returns:
- Type
- Promise.<void>
(async, static) setPoints(pointArray, circlesArray) → {Promise.<void>}
设置一组坐标点
Parameters:
| Name | Type | Description |
|---|---|---|
pointArray |
Array.<Dot> | 点数组 |
circlesArray |
Array.<Number> | 圈序列数组 (int类型的Number) |
- Source:
Returns:
- Type
- Promise.<void>
(async, static) setPointsByDots(dots, circlesArray) → {Promise.<void>}
通过点序列设置一组坐标点
Parameters:
| Name | Type | Description |
|---|---|---|
dots |
Dots | 点序列 |
circlesArray |
Array.<Number> | 圈序列数组 (int类型的Number) |
- Source:
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);