Add an image from an URL and optionally start loading it, storing the resulting TexturizableImage in a ImageItem.
Image name.
Image URL.
Optional startLoading: booleanOptional. Pass true to start loading the image in the background.
The resulting ImageItem or a promise for it if it starts loading.
Names are unique within a MapView. URLs are not unique, multiple images with different names can have the same URL. Still, URLs are are loaded only once. If an image with the same name is already registered an error is thrown.
Add an image storing it in a ImageItem.
Unique image name.
The image to add.
The resulting ImageItem
Names are unique within a MapView. If an image with the same name is already registered an error is thrown.
Remove all ImageItems from the cache.
Number of images removed.
Also removes all ImageItems that belong to this MapView from the global ImageCache.
Generated using TypeDoc
Cache images wrapped into ImageItems for a MapView.
Remarks
An image may have multiple names in a theme, the
MapViewImageCachemaps 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
MapViewImageCacheuses a global ImageCache to actually store (and generate) the image data.