You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are no other plans for changes to licensing, and the project will remain open source.
A plugin for Leaflet (v1.0.3, and v0.7.7) to create a canvas visualisation layer for direction and intensity of arbitrary velocities (e.g. wind, ocean current).
varvelocityLayer=L.velocityLayer({displayValues: true,displayOptions: {// label prefixvelocityType: "Global Wind",// leaflet control positionposition: "bottomleft",// no data at cursoremptyString: "No velocity data",// see explanation belowangleConvention: "bearingCW",// display cardinal direction alongside degreesshowCardinal: false,// one of: ['ms', 'k/h', 'mph', 'kt']speedUnit: "ms",// direction label prefixdirectionString: "Direction",// speed label prefixspeedString: "Speed",},data: data,// see demo/*.json, or wind-js-server for example data service// OPTIONALminVelocity: 0,// used to align color scalemaxVelocity: 10,// used to align color scalevelocityScale: 0.005,// modifier for particle animations, arbitrarily defaults to 0.005colorScale: [],// define your own array of hex/rgb colorsonAdd: null,// callback functiononRemove: null,// callback functionopacity: 0.97,// layer opacity, default 0.97// optional pane to add the layer, will be created if doesn't exist// leaflet v1+ only (falls back to overlayPane for < v1)paneName: "overlayPane",});
The angle convention option refers to the convention used to express the wind direction as an angle from north direction in the control.
It can be any combination of bearing (angle toward which the flow goes) or meteo (angle from which the flow comes),
and CW (angle value increases clock-wise) or CCW (angle value increases counter clock-wise). If not given defaults to bearingCCW.
The speed unit option refers to the unit used to express the wind speed in the control.
It can be m/s for meter per second, k/h for kilometer per hour or kt for knots. If not given defaults to m/s.
Public methods
method
params
description
setData
{Object}
update the layer with new data
setOptions
{Object}
update the layer with new options
Build / watch
npm run watch
Reference
leaflet-velocity is possible because of things like: