Home > mapbox-collision-boxes > collectCollisionBoxesAndFeatures
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[]>;
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
.
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.
This function waits until the last symbol placement finishes. The wait times out after five seconds.