Summary
Methods:
| getBBox |
获取Cardinal曲线箭头的三维包围盒 |
| getCoordSeqs |
获取Cardinal曲线箭头的坐标序列数组 |
| getCtrlPoints |
获取控制点的几何数组 |
| getLines |
获取Cardinal曲线箭头中所有的线状几何体对象 |
| getType |
获取几何体类型 |
| setCtrlPoints |
重新设置Cardinal曲线箭头的控制点 |
| toMultiLine |
将Cardinal曲线箭头转为多线几何体 |
Constructor
new CardinalCurveArrow(points)
使用点几何体作为控制点构造Cardinal曲线箭头,注意控制点数量至少为2,且不可以重复。
Parameters:
| Name | Type | Description |
|---|---|---|
points |
Array.<module:geom~Point> | 点几何体数组,数组长度小于2或非数组类型,则抛出构造异常。 |
Throws:
RangeError
|
TypeError
-
数组长度小于2或非数组类型,则抛出构造异常。
Example
let point1 = new hmap.geom.Point(new hmap.basetype.Coordinate(120,30,0));
let point2 = new hmap.geom.Point(new hmap.basetype.Coordinate(121,30,0));
let point3 = new hmap.geom.Point(new hmap.basetype.Coordinate(121,31,0));
let ccArrowGeom = new hmap.geomext.CardinalCurveArrow([point1,point2,point3]);
Methods
-
getBBox() → {module:basetype~BBox}
-
获取Cardinal曲线箭头的三维包围盒
-
getCoordSeqs() → {Array.<module:basetype~CoordSeq>}
-
获取Cardinal曲线箭头的坐标序列数组
Example
let coordSeqs = ccArrowGeom.getCoordSeqs(); -
getCtrlPoints() → {Array.<module:geom~Point>}
-
获取控制点的几何数组
Example
let points = geomext.getCtrlPoints(); -
getLines() → {Array.<module:geom~Line>}
-
获取Cardinal曲线箭头中所有的线状几何体对象
Example
let lines = ccArrowGeom.getLines(); -
getType() → {String}
-
获取几何体类型
Example
let type = ccArrowGeom.getType(); -
setCtrlPoints(points)
-
重新设置Cardinal曲线箭头的控制点
Parameters:
Name Type Description pointsArray.<module:geom~Point> 点几何体数组,数组长度小于2或非数组类型,则抛出构造异常。
Throws:
RangeError | TypeError -数组长度小于2或非数组类型,则抛出构造异常。
Example
let point1 = new hmap.geom.Point(new hmap.basetype.Coordinate(120,30,0)); let point2 = new hmap.geom.Point(new hmap.basetype.Coordinate(121,31,0)); let point3 = new hmap.geom.Point(new hmap.basetype.Coordinate(121,31,0)); let ccArrowGeom = new hmap.geomext.CardinalCurveArrow([point1,point2,point3]); -
toMultiLine() → {module:geom~MultiLine}
-
将Cardinal曲线箭头转为多线几何体
Example
let result = ccArrowGeom.toMultiLine();