Skip to content

flow_layer

Stable

Particles that follow a vector field, such as wind or ocean currents, with trails coloured by speed, and the flow at a clicked point.

Generated from the component's definition in the library, so it always matches the version this demo runs.

Attribute Type Default Description
id required string — Unique identifier for the layer. Read at mount.
map_id required string — ID of the map to attach to. Read at mount.
field required any — the URL of the field image
bounds list [-180, -90, 180, 90] [west, south, east, north], in degrees: the outer edges of the image. [-180, -90, 180, 90] when not given. West from -185 to under 180, east after west and at most 360 degrees east of it, south under north, both from -95 to 95: up to 5 degrees past 180°W and the poles, for the edges of pixels centred on them (see The field image). eastward (u, red) and northward (v, green) components of the flow at bytes 0 and 255, in the field's units. min under max.
u_range required list — Not documented by the library.
v_range required list — Not documented by the library.
preset string nil "wind_flow" or "ocean_currents": the values of the five attributes below that are not given; see Presets.
particles any nil integer
speed_factor any nil number
trail any nil number from 0 to under 1
particle_size any nil number, CSS pixels
opacity any nil number from 0 to 1
color_ramp any nil a list of {speed, color} tuples
before_id string nil ID of the layer to draw this one under; on top when not given. A new value after mount moves the layer.
min_zoom integer nil Not documented by the library.
max_zoom integer nil Not documented by the library.
events any [] a list of event names, or :all
class string "" Classes for the component's hidden element.