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
-
groupByLayout(
layers: LayerSpecification[],
cachedKeys?: Record<string, string>,
): LayerSpecification[][]Parameters
- layers: LayerSpecification[]
an array of LayerSpecification.
OptionalcachedKeys: Record<string, string>an object to keep already calculated keys.
Returns LayerSpecification[][]
an array of arrays of LayerSpecification objects, where each inner array contains layers that share the same layout-affecting properties.
- layers: LayerSpecification[]
Groups layers by their layout-affecting properties. These are the properties that were formerly used by explicit
refmechanism 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.