MvtSpriteAtlas

class MvtSpriteAtlas(val entries: Map<String, MvtSpriteEntry>, val imageBytes: ByteArray)

Mapbox sprite atlas: PNG bytes + JSON manifest. The PNG packs N icons into a single image and the manifest maps each icon name → its (x, y, width, height) sub-rectangle. The platform-specific iconFactory decodes the atlas once and crops per-icon on demand.

Standard Mapbox layout — a sprite endpoint exposes two files at the same URL stem:

  • <stem>.json (this manifest)

  • <stem>.png (the packed image)

Construct via MvtSpriteAtlasLoader.load for the HTTP fetch path, or directly here when you have the bytes (test fixtures, bundled assets).

Constructors

Link copied to clipboard
constructor(entries: Map<String, MvtSpriteEntry>, imageBytes: ByteArray)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Parsed manifest, keyed by icon name.

Link copied to clipboard

Raw PNG bytes for the packed atlas image — kept so the platform crop path can decode.

Functions

Link copied to clipboard
Link copied to clipboard

Construct an earth.worldwind.render.image.ImageSource.ImageFactory that, when run by the engine's image-decoder pipeline, yields just this icon's cropped sub-image. Returns null if name isn't in the manifest.

Link copied to clipboard

Drop the platform-decoded copy of this atlas from the MvtAtlasIconFactory's decode cache. Call when swapping atlases at runtime or under memory pressure; subsequent icon factories for this atlas will re-decode the PNG.