Home > @magiclane/maps-sdk > GemImage
GemImage class
GemImage class representing an image with format and metadata
Signature:
export declare class GemImage Constructors
Constructor | Modifiers | Description |
|---|---|---|
Constructor SVG bytes are accepted anywhere an image is accepted: when the bytes look like an SVG document (or |
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
number | Aspect ratio X | ||
number | Aspect ratio Y | ||
(Optional) Image format | |||
Uint8Array | (Optional) Image data | ||
number | Image ID |
Methods
Method | Modifiers | Description |
|---|---|---|
Equality comparison | ||
| Create from JSON representation | |
| Create a GemImage from SVG markup or SVG bytes. The SVG is rasterized to PNG (2× its declared size, so mm-scaled icons stay crisp on high-DPI screens) before the image is returned — the result can be handed to the engine like any PNG image. | |
Hash code calculation | ||
Convert to JSON representation | ||
Standard JS hook invoked by JSON.stringify. Delegates to toJson so Uint8Array bytes serialize as a number array (EVarList on the C++ side) rather than the default object-with-string-keys form, which would be tagged as EVarMap and produce an empty vector. | ||
Resolves once this image's pending SVG rasterization (if any) has finished. Immediate for non-SVG images. | ||
| Resolves once every pending SVG rasterization started so far (by any GemImage) has finished. Call before |