MapboxBuildingsApi

class MapboxBuildingsApi

Mapbox Buildings Api allows you to query buildings on a MapboxMap that you would like to highlight using the MapboxBuildingView.

Constructors

Link copied to clipboard
fun MapboxBuildingsApi(mapboxMap: MapboxMap)

Functions

Link copied to clipboard
fun cancel()

Cancels any/all background tasks that may be running.

Link copied to clipboard
fun queryBuildingOnFinalDestination(progress: RouteProgress, callback: MapboxNavigationConsumer<Expected<BuildingError, BuildingValue>>)

The API can be invoked to query a building on MapboxMap using the RouteProgress provided as an input. Use this function to query a building when you reach your destination. The API returns a BuildingError if there is an internal issue fetching the buildings. Otherwise, it returns buildings wrapped inside BuildingValue in a form of list of QueriedRenderedFeature. This list is empty if the building is not found on the MapboxMap

Link copied to clipboard
fun queryBuildingOnWaypoint(progress: RouteProgress, callback: MapboxNavigationConsumer<Expected<BuildingError, BuildingValue>>)

The API can be invoked to query a building on MapboxMap using the RouteProgress provided as an input. Use this function to query a building when you reach a waypoint in a multi-leg trip. The API returns a BuildingError if there is an internal issue fetching the buildings. Otherwise, it returns buildings wrapped inside BuildingValue in a form of list of QueriedRenderedFeature. This list is empty if the building is not found on the MapboxMap

Link copied to clipboard
fun queryBuildingToHighlight(point: Point, callback: MapboxNavigationConsumer<Expected<BuildingError, BuildingValue>>)

The API can be invoked to query a building on MapboxMap using the point provided as an input. The API returns a BuildingError if there is an internal issue fetching the buildings. Otherwise, it returns buildings wrapped inside BuildingValue in a form of list of QueriedRenderedFeature. This list is empty if the building is not found on the MapboxMap