Join us online - 19th of November
Save your spot
For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.

Function groupByLayout

  • Groups layers by their layout-affecting properties. These are the properties that were formerly used by explicit ref mechanism for layers: 'type', 'source', 'source-layer', 'minzoom', 'maxzoom', 'filter', and 'layout'.

    The input is not modified. The output layers are references to the input layers.

    Parameters

    Returns LayerSpecification[][]

    an array of arrays of LayerSpecification objects, where each inner array contains layers that share the same layout-affecting properties.

Was this helpful?