provideRoadShieldIcon
fun provideRoadShieldIcon(reference: IconReference, content: String): Result<Bitmap, RoadShieldIconProviderFailure>
Generates a road shield image based on a RoadShield.iconReference and the associated RoadShield.shieldContent.
The reference parameter is used to access an asset for the base road shield image. If the reference cannot be resolved to a valid image asset, a fallback image is generated - a rounded rectangle with a white background, black text and border.
Example Usage
// `roadShield` is an SDK RoadShield object.
val provider = RoadShieldIconProvider(applicationContext)
val image = provider.provideRoadShieldIcon(
reference = roadShield.iconReference,
content = roadShield.shieldContent,
).value().toAndroidBitmap()Content copied to clipboard
Return
Result containing the generated bitmap or failure information.
Parameters
reference
The reference of the base road shield image.
content
The text content to display on the shield (e.g., "I-95", "A4").