Summary
Methods:
| getBBox |
获取扇形搜索区的三维包围盒 |
| getCoordSeqs |
获取扇形搜索区对象的坐标序列数组 |
| getCtrlPoints |
获取控制点的几何数组 |
| getLines |
获取扇形搜索区中所有的线状几何体对象 |
| getType |
获取几何体类型 |
| setCtrlPoints |
重新设置扇形搜索区的控制点。 |
| toMultiLine |
将扇形搜索区对象转化为多线几何体 |
Constructor
new SectorSearch(points)
使用点几何体作为控制点构造扇形搜索区,控制点数量为2,且不可以重复。
Parameters:
| Name | Type | Description |
|---|---|---|
points |
Array.<module:geom~Point> | 点几何体数组,数组长度小于2或非数组类型时,则抛出构造异常;当数组长度大于2时,取前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 ssGeom = new hmap.geomext.SectorSearch([point1,point2]);
Methods
-
getBBox() → {module:basetype~BBox}
-
获取扇形搜索区的三维包围盒
-
getCoordSeqs() → {Array.<module:basetype~CoordSeq>}
-
获取扇形搜索区对象的坐标序列数组
Example
let coordSeqs = ssGeom.getCoordSeqs(); -
getCtrlPoints() → {Array.<module:geom~Point>}
-
获取控制点的几何数组
Example
let points = geomext.getCtrlPoints(); -
getLines() → {Array.<module:geom~Line>}
-
获取扇形搜索区中所有的线状几何体对象
Example
let lines = ssGeom.getLines(); -
getType() → {String}
-
获取几何体类型
Example
let type = ssGeom.getType(); -
setCtrlPoints(points)
-
重新设置扇形搜索区的控制点。
Parameters:
Name Type Description pointsArray.<module:geom~Point> 点几何体数组,数组长度小于2或非数组类型时,则抛出构造异常;当数组长度大于2时,取前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)); ssGeom.setCtrlPoints([point1,point2]); -
toMultiLine() → {module:geom~MultiLine}
-
将扇形搜索区对象转化为多线几何体
Example
let multiLine = ssGeom.toMultiLine();