Summary
Methods:
applyTransform |
给定一个函数,用来修改几何对象的坐标值。该方法可能改变原几何对象的坐标值,如果需要保留原几何对象,可以使用clone方法复制为副本。 |
getBBox |
获取拓展几何的三维包围盒 |
getCoordSeqs |
获取折线箭头的坐标序列数组 |
getLines |
获取折线箭头中所有的线状几何体对象 |
getType |
获取几何体类型 |
setCtrlPoints |
重新设置折线箭头的控制点。 |
toMultiLine |
将折线箭头转为多线要素 |
Constructor
new PolylineArrow(points, arrowLength)
使用点几何体作为控制点构造折线箭头,控制点数量至少为2,且不可以重复。
Parameters:
Name | Type | Description |
---|---|---|
points |
Array.<module:geom~Point> | 点几何体数组,数组长度小于2或非数组类型时,则抛出构造异常。 |
arrowLength |
Number | 箭头的长度,地图单位,默认为曲线末尾两点长度的1/10。 |
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 lineArrowGeom = new hmap.geomext.PolylineArrow([point1,point2]);
Methods
-
applyTransform(callback)
-
给定一个函数,用来修改几何对象的坐标值。该方法可能改变原几何对象的坐标值,如果需要保留原几何对象,可以使用clone方法复制为副本。
Parameters:
Name Type Description callback
function 用于处理坐标值的回调函数,回调函数的参数为坐标对象,该回调函数会作用在几何对象的每个坐标上
-
getBBox() → {module:basetype~BBox}
-
获取拓展几何的三维包围盒
-
getCoordSeqs() → {Array.<module:basetype~CoordSeq>}
-
获取折线箭头的坐标序列数组
Example
let coordSeqs = lineArrowGeom.getCoordSeqs();
-
getLines() → {Array.<module:geom~Line>}
-
获取折线箭头中所有的线状几何体对象
Example
let lines = lineArrowGeom.getLines();
-
getType() → {String}
-
获取几何体类型
Example
let type = lineArrowGeom.getType();
-
setCtrlPoints(points)
-
重新设置折线箭头的控制点。
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(121,30,0)); let point2 = new hmap.geom.Point(new hmap.basetype.Coordinate(122,30,0)); lineArrowGeom.setCtrlPoints([point1,point2]);
-
toMultiLine() → {module:geom~MultiLine}
-
将折线箭头转为多线要素
Example
let multiLine = lineArrowGeom.toMultiLine();