loadSprite

suspend fun loadSprite(id: String, jsonUrl: String, map: ImageRegisteringMap, dpr: Float = 1.0f)

Downloads sprite PNG + JSON, crops each icon, and calls ImageRegisteringMap.addImage for every entry.

Parameters

id

Prefix used in registered image ids (e.g. "mapsgl" → mapsgl:arrow).

jsonUrl

Sprite metadata URL; may contain {suffix} replaced with @Nx from dpr.

map

Target that receives addImage calls (typically the active map).

dpr

Device pixel ratio; clamps sprite variant selection (matches JS sprite resolution picking).