Skip to main content

flywave-mapview.mapviewimagecache

Home > @flywave/flywave-mapview > MapViewImageCache

MapViewImageCache class

Cache images wrapped into ImageItems for a MapView.

Signature:

export declare class MapViewImageCache 

Remarks

An image may have multiple names in a theme, the MapViewImageCache maps different names to the same image URL, and allows to share the image by URL to different MapViews. Within a MapView instance, the (optional) name is unique, so registering multiple images with the same name is invalid.

The MapViewImageCache uses a global to actually store (and generate) the image data.

Methods

Method

Modifiers

Description

addImage(name, url, startLoading)

Add an image from an URL and optionally start loading it, storing the resulting TexturizableImage in a ImageItem.

addImage(name, image)

Add an image storing it in a ImageItem.

clear()

Remove all ImageItems from the cache.

findImageByName(name)

Find ImageItem by its name.

removeImage(name)

Remove the image with this name from the cache.