IonResource

open external class IonResource(endpoint: JsAny, endpointResource: Resource)(source)

A Resource instance that encapsulates Cesium ion asset access. This object is normally not instantiated directly, use IonResource.fromAssetId.

Parameters

endpoint

The result of the Cesium ion asset endpoint service.

endpointResource

The original resource used to retrieve the endpoint.

See also

Constructors

Link copied to clipboard
constructor(endpoint: JsAny, endpointResource: Resource)

Types

Link copied to clipboard
external object Companion
Link copied to clipboard
external interface FetchImageOptions

Properties

Link copied to clipboard

Gets the credits required for attribution of the asset.

Functions

Link copied to clipboard
external fun clone(result: Resource? = definedExternally): Resource

Duplicates a Resource instance.

Link copied to clipboard
suspend external fun fetchImage(options: IonResource.FetchImageOptions? = definedExternally): CanvasImageSource?

Asynchronously loads the given image resource. Returns a promise that will resolve to an ImageBitmap if preferImageBitmap is true and the browser supports createImageBitmap or otherwise an Image once loaded, or reject if the image failed to load.

Link copied to clipboard
external fun fetchImageAsync(options: IonResource.FetchImageOptions? = definedExternally): Promise<CanvasImageSource>?