Summary
Methods:
getBBox |
获取三点圆弧的三维包围盒 |
getCoordSeq |
获取圆弧的坐标序列 |
getLength |
计算三点圆弧组成点连线的长度 |
getType |
获取几何体类型 |
setCtrlPoints |
重新设置三点圆弧的控制点。 |
toLine |
将三点圆弧转化为线几何体 |
Constructor
new Arc(points)
使用点几何体作为控制点构造三点圆弧,控制点数量为3,且不可重复。
Parameters:
Name | Type | Description |
---|---|---|
points |
Array.<module:geom~Point> | 点几何体数组,数组长度小于3或非数组类型时,则抛出构造异常;当数组长度大于3时,取前三个点几何体作为控制点。 |
Throws:
RangeError
|
TypeError
-
数组长度小于3或非数组类型,则抛出构造异常。
Example
let point1 = new hmap.geom.Point(new hmap.basetype.Coordinate(120,30,0));
let point2 = new hmap.geom.Point(new hmap.basetype.Coordinate(120,31,0));
let point3 = new hmap.geom.Point(new hmap.basetype.Coordinate(121,31,0));
let arcGeom = new hmap.geomext.Arc([point1,point2,point3]);
Methods
-
getBBox() → {module:basetype~BBox}
-
获取三点圆弧的三维包围盒
-
getCoordSeq()
-
获取圆弧的坐标序列
Example
let coordSeq = arcGeom.getCoordSeq();
-
getLength(srid) → {Number}
-
计算三点圆弧组成点连线的长度
Parameters:
Name Type Description srid
String 坐标系类型
Returns:
Number -线段的三维长度,单位米。
Example
let length = arcGeom.getLength("4326");
-
getType() → {String}
-
获取几何体类型
Example
let type = arcGeom.getType();
-
setCtrlPoints(points)
-
重新设置三点圆弧的控制点。
Parameters:
Name Type Description points
Array.<module:geom~Point> 点几何体数组,数组长度小于3或非数组类型时,则抛出构造异常;当数组长度大于3时,取前三个点几何体作为控制点。
Throws:
RangeError | TypeError -数组长度小于3或非数组类型,则抛出构造异常。
Example
let point1 = new hmap.geom.Point(new hmap.basetype.Coordinate(122,30,0)); let point2 = new hmap.geom.Point(new hmap.basetype.Coordinate(122,31,0)); let point3 = new hmap.geom.Point(new hmap.basetype.Coordinate(123,31,0)); arcGeom.setCtrlPoints([point1,point2,point3])
-
toLine() → {module:geom~Line}
-
将三点圆弧转化为线几何体
Example
let line = arcGeom.toLine();