geosolution/math~FlowModel(options)

地理解决方案数学模型-流线模型,大约可以支持150万条由2个坐标点组成的线段

Summary

Methods:
addMathCell

添加一个流线要素

pause

动画暂停

removeAll

清空流线model中的流线要素

removeMathCellById

根据该数学模型组成元素的唯一标识符,将对应的元素从数学模型中移除

start

动画开启

Constructor

new FlowModel(options)

流线动画图层,与蝌蚪图类似,缺点是不能设置线宽

Parameters:
Name Type Description
options Object
Name Type Description
loop Boolean

流线动画是否循环播放,默认为true,注意如果未设置循环播放,播放结束后流线对象虽然不再显示,但是并没有被删除,需要手动去移除和删除。

blendMode String

混合模式,当前有两种设置模式,“additive”和“normal”。“additive”为颜色叠加,红、绿、蓝三种颜色的线相交部分为白色;“normal”为透明度混合,物体表现为前后遮挡,默认为“additive”。

depthTest Boolean

是否开启深度测试,默认为false

Example
let flowModel=new hmap.geosolution.math.FlowModel({
    loop:true
});

Methods

addMathCell(flow)

添加一个流线要素

Parameters:
Name Type Description
flow module:geosolution/cell~Flow

流线要素

Throws:
TypeError -

参数类型出错,抛出异常。

Example
let coordSeq = new hmap.basetype.CoordSeq[new hmap.basetype.Coordinate(120.13,30.19,0.0),new hmap.basetype.Coordinate(120.43,30.19,0.0)];
let flow = new hmap.geosolution.cell.Flow({coordSeq:coordSeq});
flowModel.addMathCell(flow);

pause()

动画暂停

removeAll()

清空流线model中的流线要素

Example
flowModel.removeAll()

removeMathCellById(id)

根据该数学模型组成元素的唯一标识符,将对应的元素从数学模型中移除

Parameters:
Name Type Description
id String

组成元素的唯一标识符

start()

动画开启