getRoadShields

fun getRoadShields(maneuvers: List<Maneuver>, shieldCallback: RouteShieldCallback)

Given a list of Maneuver the function requests legacy road shields (if available) using BannerComponents.imageBaseUrl associated in RoadShieldComponentNode.

If you do not wish to download all of the shields at once, make sure to pass in only a list of maneuvers that you'd like download the road shields.

The function is safe to be called repeatably, all the results are cached in-memory and requests are managed to avoid duplicating network bandwidth usage.

The function returns list of either RouteShieldError or RouteShieldResult in RouteShieldCallback.onRoadShields and can be used when displaying PrimaryManeuver, SecondaryManeuver and SubManeuver.

Parameters

maneuvers

list of maneuvers

shieldCallback

invoked with appropriate result

See also

MapboxManeuverView.renderManeuverWith

fun getRoadShields(userId: String?, styleId: String?, maneuvers: List<Maneuver>, shieldCallback: RouteShieldCallback)

Given a list of Maneuver the function requests mapbox designed road shields (if available) using BannerComponents.mapboxShield associated in RoadShieldComponentNode. If for any reason the API fails to download the mapbox designed shields, it fallbacks to use legacy BannerComponents.imageBaseUrl if available.

If you do not wish to download all of the shields at once, make sure to pass in only a list of maneuvers that you'd like download the road shields.

The function is safe to be called repeatably, all the results are cached in-memory and requests are managed to avoid duplicating network bandwidth usage.

The function returns list of either RouteShieldError or RouteShieldResult in RouteShieldCallback.onRoadShields and can be used when displaying PrimaryManeuver, SecondaryManeuver and SubManeuver.

Parameters

userId

Mapbox user account name

styleId

style id used to render the map

maneuvers

list of maneuvers

shieldCallback

invoked with appropriate result


fun getRoadShields(userId: String?, styleId: String?, maneuvers: List<Maneuver>, fontConfig: ShieldFontConfig?, shieldCallback: RouteShieldCallback)

Given a list of Maneuver the function requests mapbox designed road shields (if available) using BannerComponents.mapboxShield associated in RoadShieldComponentNode. If for any reason the API fails to download the mapbox designed shields, it fallbacks to use legacy BannerComponents.imageBaseUrl if available.

If you do not wish to download all of the shields at once, make sure to pass in only a list of maneuvers that you'd like download the road shields.

The function is safe to be called repeatably, all the results are cached in-memory and requests are managed to avoid duplicating network bandwidth usage.

The function returns list of either RouteShieldError or RouteShieldResult in RouteShieldCallback.onRoadShields and can be used when displaying PrimaryManeuver, SecondaryManeuver and SubManeuver.

Parameters

userId

Mapbox user account name

styleId

style id used to render the map

maneuvers

list of maneuvers

fontConfig

font configuration for MapboxShield.displayRef rendering. Config is ignored in case of fallback to legacy shields.

shieldCallback

invoked with appropriate result