Wind

GeoGlobe.Visuals.Custom. Wind

风向图层

Constructor

new Wind(options)

Author:
  • kz
Example
//构造地图对象
 var map = new GeoGlobe.Map({
    style: Cfg.style,
    container: 'map',
    zoom: 11,
    bearing: 0,
	pitch: 0,
    center: [114.77402594421665, 30.28162351834304]
 });
 //构造可视化定制图层
 var custom = new GeoGlobe.Visuals.Custom();
 //添加到地图中
 custom.addTo(map);
 //构造风向图层
 var wind = new GeoGlobe.Visuals.Custom.Wind({
    id: "wind_1",
    data: data,
    visibility: true,
    rendererOptions: {
        velocityScale: 0.011,
        particleMultiplier: 0.002,
        maxWindIntensity: 30,
        lineWidth: 2,
        opacity: 0.6,
        colors: [
            '#00ffff',
            '#64f0ff',
            '#87e1ff',
            '#a0d0ff',
            '#b5c0ff',
            '#c6adff',
            '#d49bff',
            '#e185ff',
            '#ec6dff',
            '#ff1edb'
        ]
    }
});
 //添加到可视化定制图层
 wind.addTo(custom);
 //绘制
 custom.render();
Parameters:
Name Type Description
options Object
Properties
Name Type Description
id String 图层id
data Array 数据
visibility Boolean 图层默认是否显示
rendererOptions Object 渲染配置
Properties
Name Type Description
velocityScale Number 风速的比例
particleMultiplier Number 粒子计数标量,1平方像素内粒子数
maxWindIntensity Number 所能表示粒子强度最大的风速
lineWidth Number 绘制粒子的线宽
opacity Number 绘制粒子的线的不透明度
colors Array 各强度风速的颜色

Members

canvas :Object

画布
Type:
  • Object

canvasContext :Object

画布2d上下文
Type:
  • Object

Methods

addTo(custom)

关联可视化定制图层对象
Parameters:
Name Type Description
custom GeoGlobe.Visuals.Custom 可视化定制图层对象

clearCanvas()

画布清空

destroy()

画布销毁

draw()

图层绘制

initialize(options)

构造函数
Parameters:
Name Type Description
options Object 参数对象

onMove()

图层(地图)移动时触发

onMoveEnd()

图层(地图)移动结束时触发

onResize()

图层自适应

redraw()

图层重绘

render()

渲染图层

setData(data)

数据的处理
Parameters:
Name Type Description
data Array 数据

setVisible(visibility)

图层的显示与隐藏
Parameters:
Name Type Description
visibility Boolean 可见性

stopDraw()

停止绘制