WindGLV

区域风场GL

new YS.WindGLV(ys, data, options)

区域风场GL
Name Type Description
ys YouScene youscene对象
data Object 风场数据, data有下面这些属性
Name Type Description
rect Object 风场范围
values Array 起风点数组, 具体格式看下面示例,point是坐标,fs是风速,fx是风向
options Object optional options 有下面这些属性
Name Type Default Description
width Number 720 optional 风场gl纹理的宽度,像素单位
height Number 360 optional 风场gl纹理的高度,像素单位
numParticles Number 5000 optional 风场gl粒子的数量
isLegend Number true optional 是否需要风速图例背景
Example:
var data = {
    rect: {
        west: 114.335153,
        south: 30.4091145,
        east: 114.417997,
        north: 30.4527565
    },
    values: [
        {
            point: {x: 114.355864, y: 30.420128, z: 0},
            fs: 24.72,
            fx: 151.92
        },
        {
            point: {x: 114.368048, y: 30.441846, z: 0},
            fs: 27.64,
            fx: 12
        },
        {
            point: {x: 114.373187, y: 30.428982, z: 0},
            fs: 37.36,
            fx: 285.84
        },
        {
            point: {x: 114.387704, y: 30.439818, z: 0},
            fs: 14.76,
            fx: 331.2
        },
        {
            point: {x: 114.397286, y: 30.420025, z: 0},
            fs: 21.32,
            fx: 162
        }
    ]
}
var wind = new YS.WindGLV(ys, data);
wind.init();

Methods

destroy()

销毁风场

init()

初始化风场