Skip to content

Latest commit

 

History

History
44 lines (25 loc) · 1.4 KB

mapbox-collision-boxes.collectcollisionboxesandfeatures.md

File metadata and controls

44 lines (25 loc) · 1.4 KB

Home > mapbox-collision-boxes > collectCollisionBoxesAndFeatures

collectCollisionBoxesAndFeatures() function

This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Collects collision boxes on a given Mapbox map layer.

Signature:

export declare function collectCollisionBoxesAndFeatures(map: Map, layerId: string): Promise<FeatureBox[]>;

Parameters

Parameter Type Description
map Map Mapbox map instance.
layerId string ID of the layer where collision boxes are to be collected.

Returns:

Promise<FeatureBox[]>

Collision boxes and features on the layer associated with layerId on map.

Exceptions

RangeError

If there is no layer associated with layerId, or if the layer associated with layerId is not a symbol layer.

Error

If there is an error.

Remarks

This function waits until the last symbol placement finishes. The wait times out after five seconds.