Skip to content

custom_layer

Stable

A custom WebGL layer drawn with your own GLSL shaders, whose uniforms follow the LiveView's assigns.

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. source. A new vertex_shader or fragment_shader after mount replaces the layer, in the same place, with one drawn with the new shaders (its points start anew). Without either, the component raises an ArgumentError.
vertex_shader required string — Not documented by the library.
fragment_shader required string — Not documented by the library.
uniforms map %{} The shaders' uniforms; see Uniforms above. A new value after mount is drawn from the next frame.
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. value after mount applies at once; a bound no longer given adds the layer again, without it (its particles start anew).
min_zoom integer nil Not documented by the library.
max_zoom integer nil Not documented by the library.
class string "" Classes for the component's hidden element.