get Route Shields
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.
See also
Parameters
list of banner components
invoked with appropriate result
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.
See also
Parameters
list of banner components
Mapbox user account name
style id used to render the map
public access token
invoked with appropriate result
Given a Road object, the function requests mapbox legacy road shields (if available) using Road.shieldUrl 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.
See also
Parameters
object representing current road
invoked with appropriate result
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.
See also
Parameters
object representing current road
Mapbox user account name
style id used to render the map
public access token
invoked with appropriate result