Wind layer
The WindLayer shows the atmospheric wind speed in meter per second (m/s). Forecast for speed and direction at an altitude of 10 m above ground.
The WindLayer contains both a background to which is applied a color ramp and a set of moving particles, for this reason, the constructor WindLayer has more options that then other weather layers.
Example
Parameters
Options to provide to the Layer constructor
(WindLayerOptions)
options.id
default: "MapTiler Wind"
|
ID of the layer |
---|---|
options.colorramp
ColorRamp
default:
ColorRamp.builtin.VIRIDIS |
Colormap to use. Maximum range possible spans from 0 m/s to 75 m/s. Default spans from 0 m/s to 40 m/s |
options.opacity
default: 1
|
Opacity of the layer in [0, 1] |
options.smooth
default: true
|
Whether or not the colorramp must be smooth |
options.color
RgbaColor
default: [255, 255, 255, 192]
|
Color of the particle. RGBA 0-255. |
options.fastColor
RgbaColor
default: same as color
|
Color of the particle when moving "fast". RGBA 0-255. |
options.density
default: 2
|
Number of particles visible per 1000 px^2 |
options.fadeFactor
default: 0.1
|
How much the particles fade over time |
options.fastSpeed | What is considered "fast" (in px/sec) for coloring purposes. Only makes sense when fastColor is used |
options.maxAmount
default: 128
|
Quantity of particles to be created. Has to be a power of 2 and at least 4. The actual exact number will be particles * particles.
Try to keep this value as low as possible to optimize performance.
The number of actually visible particles is determined by density.
|
options.pixelRatio
default: 2 for normal displays and 1 for HiDPI displays
|
Use more pixels to make particles more smooth (especially when tilted) |
options.refreshInterval
default: 800
|
Time interval (in milliseconds) how often the particles are refreshed to avoid degradation. Random 1/16 of the particles is always randomly reset |
options.size
default: 1.5
|
Size of the particle |
options.speed
default: 0.001
|
Speed factor of the particles |
options.fastIsLarger
default: false
|
If this is true , the particles gets slighly larger as they become faster.
|
Methods
Check out the Layers method reference
Get the wind speed and direction in multiple measurement units at a given location
Object
: the value(s) as an object.
compassDirection | Conventionnaly, wind direction is refered as where the wind comes from. For instance a north wind is a wind coming from the north. This property retrieves one of the 16 compass direction. |
---|---|
directionAngle | Angular direction in dregree towards which the wind is blowing, with:
|
speedFeetPerSecond | Wind speed in ft/s (feet per second) |
speedKilometersPerHour | Wind speed in km/h (kilometer per hour) |
speedKnots | Wind speed in knots (nautical miles per hour) |
speedMetersPerSecond | Wind speed in m/s (meters per second) |
speedMilesPerHour | Wind speed in mph (miles per hour) |
Events
Check out the Layers events reference