getRouteShields
Given a list of BannerComponents the function requests mapbox legacy road shields (if available) using BannerComponents.imageBaseUrl.
If you do not wish to download all of the shields at once, make sure to pass in only a list of banner components for which 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 RouteShieldResult or RouteShieldError in RouteShieldCallback.onRoadShields.
To convert the returned in RouteShield SVG ByteArray to a Bitmap use toBitmap.
Parameters
list of banner components
invoked with appropriate result
See also
Given a list of BannerComponents the function requests mapbox designed road shields (if available) using BannerComponents.mapboxShield. If for any reason the API is unable to download the shield, it falls back to download and return the legacy shield if available. Returns error otherwise.
If you do not wish to download all of the shields at once, make sure to pass in only a list of banner components for which 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 RouteShieldResult or RouteShieldError in RouteShieldCallback.onRoadShields.
To convert the returned in RouteShield SVG ByteArray to a Bitmap use toBitmap.
Parameters
list of banner components
Mapbox user account name
style id used to render the map
invoked with appropriate result
See also
Given a Road object, the function requests mapbox legacy road shields (if available) using Road.components shields url for the current road.
The function returns list of RouteShieldResult or RouteShieldError in RouteShieldCallback.onRoadShields.
To convert the returned in RouteShield SVG ByteArray to a Bitmap use toBitmap.
Parameters
object representing current road
invoked with appropriate result
See also
Given a Road object, the function requests mapbox designed road shields (if available) using Road.mapboxShield for the current road. If for any reason the API is unable to download the shield, it falls back to download and return the legacy shield if available. Returns error otherwise.
The function returns list of RouteShieldResult or RouteShieldError in RouteShieldCallback.onRoadShields.
To convert the returned in RouteShield SVG ByteArray to a Bitmap use toBitmap.
Parameters
object representing current road
Mapbox user account name
style id used to render the map
invoked with appropriate result