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[]
Was this helpful?
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.