ImageSpriteManager interface

A manager for the map control's image sprite. Exposed through the imageSprite property of the atlas.Map class. Cannot be instantiated by the user.

Methods

add(string, string | HTMLImageElement | ImageData)

Add an icon image to the map's image sprite for use with symbols and patterns.

clear()

Removes all images added by the user.

getImageIds()

Gets a list of all the image ids that have been added to the maps image sprite.

hasImage(string)

Checks to see if an image is already loaded into the maps image sprite.

remove(string)

Removes an image from the map's image sprite.

Method Details

add(string, string | HTMLImageElement | ImageData)

Add an icon image to the map's image sprite for use with symbols and patterns.

function add(id: string, icon: string | HTMLImageElement | ImageData)

Parameters

id
string

The image's id. If the specified id matches the id of a previously added image the new image will be ignored.

icon
string | HTMLImageElement | ImageData

The image to add to the map's sprite. Can be a data URI, inline SVG, or image URL.

Returns

Promise<void>

clear()

Removes all images added by the user.

function clear()

getImageIds()

Gets a list of all the image ids that have been added to the maps image sprite.

function getImageIds()

Returns

string[]

hasImage(string)

Checks to see if an image is already loaded into the maps image sprite.

function hasImage(id: string)

Parameters

id
string

The id to check the map's image sprite for.

Returns

boolean

remove(string)

Removes an image from the map's image sprite.

function remove(id: string)

Parameters

id
string

The id of the image to remove.