VectorLayer renders wind barbs as icons with adaptive sampling based on zoom and viewport.
The layer accepts lonlatGrid as point geometry and samples vectors from dataDir and dataMag.
Supported lonlatGrid layouts:
-
Flattened structured grid (preferred for
quadkeymode):lonlatGrid: 1D array of[lon, lat]shape:[rows, cols]dataDir: 1D array of direction values (degrees)dataMag: 1D array of magnitude/speed values
-
Flattened point list (unstructured/spherical sampling):
lonlatGrid: 1D array of[lon, lat]dataDir: 1D array of direction values (degrees)dataMag: 1D array of magnitude/speed valuesshapeis optional and only used by thequadkeyfast path.
For all modes, arrays are expected in index-aligned order (lonlatGrid[i], dataDir[i], dataMag[i]).
In addition to inherited CompositeLayer/IconLayer props, VectorLayer supports:
| Prop | Type | Required | Default | Notes |
|---|---|---|---|---|
lonlatGrid |
Array<[number, number]> |
Yes | None | Point geometry used for barb placement. |
dataDir |
ArrayLike<number> |
Yes | None | Direction in degrees, aligned to lonlatGrid index. |
dataMag |
ArrayLike<number> |
Yes | None | Magnitude/speed, aligned to lonlatGrid index. |
shape |
[number, number] | null |
Conditional | null |
Required for structured quadkey fast sampling ([rows, cols]). Optional otherwise. |
triangulationMode |
'quadkey' | 'unstructured' |
No | 'quadkey' |
Sampling strategy. quadkey uses grid-based stepping when shape is provided. |
sizeScale |
number |
No | 25 |
Base icon scale. Effective scale also depends on zoom. |
spacingScale |
number |
No | 1 |
Multiplier for symbol spacing. Larger values create sparser barbs. |
elevation |
number |
No | 0 |
Z coordinate for placed symbols. |
angleOffset |
number |
No | 0 |
Extra rotation offset (commonly 180 for globe orientation). |
billboard |
boolean |
No | false |
Forwarded to icon rendering behavior. |
getColor |
Accessor<Color> |
No | `(x) => x.color | |
getLabel |
Accessor<string> |
No | (x) => x.label |
Label accessor (if used by consumers). |
getWeight |
Accessor<number> |
No | `(x) => x.weight | |
getPosition |
Accessor<[number, number, number?]> |
No | (x) => x.position |
Position accessor override. |
parameters |
object |
No | { depthCompare: 'always', cullMode: 'front' } |
GPU render-state overrides. |
id |
string |
No | deck.gl generated layer id | Standard layer id override. |
Requirement rules:
lonlatGrid,dataDir, anddataMagare required.- If using structured
quadkeysampling, provideshapeas[rows, cols]. - For structured grids,
rows * colsshould match the length oflonlatGrid,dataDir, anddataMag.
- Directions are converted to icon angle with
-direction + 180 + angleOffset. - Magnitudes are bucketed in 5-unit increments for barb icon selection.
quadkeymode withshapeuses viewport-aware grid stepping for performance.unstructuredcurrently use projected screen-space decimation.- Invalid/non-finite coordinates or vector values are skipped during rendering.
- The internal icon sublayer is rendered with
pickable: false.