# Class: ImageRegistry
The ImageRegistry
is a container for map icon images.
Images can be registered and retrieved by ID.
# Hierarchy
- ImageRegistry
# Constructors
# constructor
+ new ImageRegistry(context
: FlowCoreContext): ImageRegistry
Constructs a new ImageRegistry
.
# Parameters:
Name | Type | Description |
---|---|---|
context | FlowCoreContext | The parent Flo.w context object. |
Returns: ImageRegistry
# Methods
# getImage
▸ getImage(id
: string): HTMLImageElement
Get a map icon image.
# Parameters:
Name | Type | Description |
---|---|---|
id | string | Image ID. |
Returns: HTMLImageElement
The map icon image as an HTMLImageElement
.
# getImageInfo
▸ getImageInfo(id
: string): ImageRegistryEntry
Get an image registry entry.
# Parameters:
Name | Type | Description |
---|---|---|
id | string | Image ID. |
Returns: ImageRegistryEntry
The image registry entry.
# registerImage
▸ registerImage(id
: string, src
: string, width?
: number, height?
: number, pixelDensity?
: number, recolor?
: boolean): ImageRegistryEntry
Register a map icon image.
# Parameters:
Name | Type | Default value | Description |
---|---|---|---|
id | string | - | Image ID. |
src | string | - | Image source URL. |
width? | number | - | Image display width. |
height? | number | - | Image display height. |
pixelDensity | number | 2 | Image pixel density. Defaults to 2 - the source image should be @2x resolution to enable better quality rendering on high-resolution displays. |
recolor | boolean | false | Set to true to allow recoloring of map icon image using map layer style properties. |
Returns: ImageRegistryEntry
# unregisterImage
▸ unregisterImage(id
: string): void
Un-register a map icon image.
# Parameters:
Name | Type | Description |
---|---|---|
id | string | Image ID. |
Returns: void