MapboxRouteShieldApi
A class that can be used to request route shields using either BannerComponents.imageBaseUrl or BannerComponents.mapboxShield. The class exposes API(s) that one can invoke to either always use mapbox legacy shields BannerComponents.imageBaseUrl or use mapbox designed shields BannerComponents.mapboxShield. In cases where API is unable to download mapbox designed shields for any reason, the API falls back to download legacy shields if available. Returns error otherwise.
MapboxRouteShieldApi returns route shield with text in the form of a SVG wrapped in a ByteArray. Since this SVG would later have to be converted to vector drawable at runtime for rendering purposes, it is important to note that the API supports most of the SVG features from Tiny SVG 1.2.
Functions
Given a Road object, the function requests mapbox legacy road shields (if available) using Road.components shields url for the current road.
Given a list of BannerComponents the function requests mapbox legacy road shields (if available) using BannerComponents.imageBaseUrl.
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.
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.