---
title: "ArrowLayerOptions | Weather SDK | JavaScript maps SDK"
description: "Documentation for Weather JS"
---

# Type Alias ArrowLayerOptions

Options specific to the arrow visualization

type ArrowLayerOptions \= {  
    [color](#color)?: [RgbaColor](https://docs.maptiler.com/sdk-js/modules/weather/api-reference/types/RgbaColor/);  
    [decodeAsWaves](#decodeaswaves)?: boolean;  
    [decodeChannels](#decodechannels)?: string;  
    [decodeMax](#decodemax): number;  
    [decodeMin](#decodemin): number;  
    [density](#density)?: number;  
    [fastColor](#fastcolor)?: [RgbaColor](https://docs.maptiler.com/sdk-js/modules/weather/api-reference/types/RgbaColor/);  
    [fastSpeedNorm](#fastspeednorm)?: number;  
    [maxAmount](#maxamount)?: number;  
    [maxWindSpeed](#maxwindspeed)?: number;  
    [minSize](#minsize)?: number;  
    [pixelRatio](#pixelratio)?: number;  
    [refreshInterval](#refreshinterval)?: number;  
    [rttTimestep](#rtttimestep)?: number;  
    [scaleSize](#scalesize)?:  
        | boolean  
        | {  
            arrowMinSize?: number;  
            decodeChannels: string;  
            decodeMax: number;  
            decodeMin: number;  
        };  
    [size](#size)?: number;  
    [speed](#speed)?: number;  
    [speedWeightedByVectorNorm](#speedweightedbyvectornorm)?: boolean;  
}

##### Index

### Properties

[color?](#color) [decodeAsWaves?](#decodeaswaves) [decodeChannels?](#decodechannels) [decodeMax](#decodemax) [decodeMin](#decodemin) [density?](#density) [fastColor?](#fastcolor) [fastSpeedNorm?](#fastspeednorm) [maxAmount?](#maxamount) [maxWindSpeed?](#maxwindspeed) [minSize?](#minsize) [pixelRatio?](#pixelratio) [refreshInterval?](#refreshinterval) [rttTimestep?](#rtttimestep) [scaleSize?](#scalesize) [size?](#size) [speed?](#speed) [speedWeightedByVectorNorm?](#speedweightedbyvectornorm)

## Properties

### `Optional`color[](#color)

color?: [RgbaColor](https://docs.maptiler.com/sdk-js/modules/weather/api-reference/types/RgbaColor/)

Color of the arrows. RGBA 0-255. Defaults to `[255, 255, 255, 192]`

### `Optional`decodeAsWaves[](#decodeaswaves)

decodeAsWaves?: boolean

Decode the channels as "direction + period" rather than "UV".

If true, the first channel is assumed to be direction (0-360deg) and the second to be the period (1/speed).

### `Optional`decodeChannels[](#decodechannels)

decodeChannels?: string

Channels to read the UV values from. Defaults to `rg`

### decodeMax[](#decodemax)

decodeMax: number

Maximum encoded value.

### decodeMin[](#decodemin)

decodeMin: number

Minimum encoded value.

### `Optional`density[](#density)

density?: number

Number of arrows visible per 1000 px^2. Default is `2`.

### `Optional`fastColor[](#fastcolor)

fastColor?: [RgbaColor](https://docs.maptiler.com/sdk-js/modules/weather/api-reference/types/RgbaColor/)

Color of the arrow when the wind speed reaches [fastSpeedNorm](#fastspeednorm). Defaults to [color](#color).

### `Optional`fastSpeedNorm[](#fastspeednorm)

fastSpeedNorm?: number

Normalized wind speed threshold (0–1 relative to [maxWindSpeed](#maxwindspeed)) at which the arrow color fully transitions from [color](#color) to [fastColor](#fastcolor). A value of 0.5 means the blend completes at half of the maximum wind speed. Only meaningful when [fastColor](#fastcolor) is set. Default: 0.5

### `Optional`maxAmount[](#maxamount)

maxAmount?: number

Quantity of arrows to be created. Default value is `128`. Has to be a power of 2 and at least `4`. The actual exact number will be `arrows * arrows`. Try to keep this value as low as possible to optimize performance.

The number of actually visible arrows is determined by [density](#density).

### `Optional`maxWindSpeed[](#maxwindspeed)

maxWindSpeed?: number

The wind speed (in the same units as [decodeMax](#decodemax)) that maps to a normalized speed of 1.0. Arrow opacity and size scale linearly from 0 at calm to their maximum at this speed. Defaults to [decodeMax](#decodemax) so that arrows at maximum encoded wind speed are fully opaque and full-size.

Reducing this value makes arrows reach full opacity/size at a lower wind speed (useful when the true maximum is rarely observed in practice).

### `Optional`minSize[](#minsize)

minSize?: number

Minimum arrow point size in logical pixels when wind speed is zero. Keeps gl\_PointSize non-zero so temporal blending remains stable even in calm areas. Defaults to `2`.

### `Optional`pixelRatio[](#pixelratio)

pixelRatio?: number

Use more pixels to make arrows more smooth (especially when tilted). Defaults to `2` for normal displays and `1` for HiDPI displays.

### `Optional`refreshInterval[](#refreshinterval)

refreshInterval?: number

Time interval (in milliseconds) how often the arrows are refreshed to avoid degradation. Random `1/4` of the arrows is always randomly reset. Default value is `800`.

### `Optional`rttTimestep[](#rtttimestep)

rttTimestep?: number

Max milliseconds between particle simulation (RTT) steps. Lower = smoother motion (fade still uses `refreshInterval` separately). `0` runs simulation every map prerender frame. Very large values make motion stutter because positions only advance when this elapses. Default: `1000/60` (~one step per display frame at 60Hz).

### `Optional`scaleSize[](#scalesize)

scaleSize?:  
    | boolean  
    | {  
        arrowMinSize?: number;  
        decodeChannels: string;  
        decodeMax: number;  
        decodeMin: number;  
    }

Should the size of the arrow be scaled. If `true`, the size of the arrows is scaled by its speed. In this case, make sure the option `speedWeightedByVectorNorm` is set to `true` or all the arrows will have the same speed, hence the same size.

If `false`, the size of the arrows is constant and defined by the `size` options. If an object of shape `{decodeCahnnels: string, decodeMin: number, decodemax: number}` then the arrows are scaled on the data present in the channel given with a linear factor. The formula to compute the size of an arrow is as follow: size = arrowMinSize + option.size \* (decodedChannelValue - decodeMin) / (decodeMax - decodeMin)

if `decodedChannelValue` is bellow 0, then the arrow is discarded. Default: true

#### Type Declaration

-   boolean
-   {  
        arrowMinSize?: number;  
        decodeChannels: string;  
        decodeMax: number;  
        decodeMin: number;  
    }
    -   ##### `Optional`arrowMinSize?: number
        
        Minimal size of arrow
        
    -   ##### decodeChannels: string
        
        Channel to use as a source of data. Can be `r`, `g`, `b`, or `a`.
        
    -   ##### decodeMax: number
        
        Real world value corresponding to the upper bound of the \[0, 255\] range
        
    -   ##### decodeMin: number
        
        Real world value corresponding to the lower bound of the \[0, 255\] range
        

### `Optional`size[](#size)

size?: number

Maximum size of an arrow at full wind speed, in logical pixels. Defaults to `1.5`

### `Optional`speed[](#speed)

speed?: number

Speed factor of the arrows. Defaults to `0.001`

### `Optional`speedWeightedByVectorNorm[](#speedweightedbyvectornorm)

speedWeightedByVectorNorm?: boolean

If `true`, the arrow speed will be weighted by the norm of the UV vector. If `false`, the arrow speed is only defined by the options `speed`. Default: true.
