fromAsset

fun fromAsset(context: Context, assetName: String, anchor: Point? = null, scaledSize: Size? = null): Icon

Build an Icon from a file packaged under the app's assets/ directory.

Decodes synchronously on the calling thread — for large assets, invoke off the main thread.

val icon = Icon.fromAsset(context, "markers/store_pin.png")

Throws

if the asset cannot be read or decoded.