provideExitSignIcon
fun provideExitSignIcon(reference: IconReference, content: String): Result<Bitmap, RoadShieldIconProviderFailure>
Generates an exit sign image.
The reference parameter is used to construct an image for the exit sign. If the reference cannot be resolved to a valid image asset, a fallback image is generated.
An exit sign reference can be obtained from GuidanceInstructions which are provided by navigation engine during the navigation session.
Example Usage
val provider = RoadShieldIconProvider(context)
val image = guidanceInstruction?.signpost?.exitIconReference?.let { exitIconReference ->
val exitNumber = guidanceInstruction?.signpost?.exitNumber.orEmpty()
provider.provideExitSignIcon(
reference = exitIconReference,
content = exitNumber,
).value().toAndroidBitmap()
}Content copied to clipboard
Return
Result containing the generated bitmap or failure information.
Parameters
reference
The reference of the base exit sign image.
content
The exit number or identifier text (e.g., "42A", "Exit 15").