Skip to main content

ZarrImageryLayer

Cesium imagery layer backed by a shared ZarrTileProvider.

Extends​

  • ImageryLayer

Constructors​

Constructor​

new ZarrImageryLayer(imageryProvider?, options?): ZarrImageryLayer;

Parameters​

ParameterType
imageryProvider?ImageryProvider
options?ConstructorOptions

Returns​

ZarrImageryLayer

Inherited from​

ImageryLayer.constructor

Methods​

destroy()​

destroy(): void;

Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.



Once an object is destroyed, it should not be used; calling any function other than isDestroyed will result in a DeveloperError exception. Therefore, assign the return value (undefined) to the object as done in the example.

Returns​

void

Example​

imageryLayer = imageryLayer && imageryLayer.destroy();

Inherited from​

ImageryLayer.destroy

getImageryRectangle()​

getImageryRectangle(): Rectangle;

Computes the intersection of this layer's rectangle with the imagery provider's availability rectangle, producing the overall bounds of imagery that can be produced by this layer.

Returns​

Rectangle

A rectangle which defines the overall bounds of imagery that can be produced by this layer.

Example​

// Zoom to an imagery layer.
const imageryRectangle = imageryLayer.getImageryRectangle();
scene.camera.flyTo({
destination: rectangle
});

Inherited from​

ImageryLayer.getImageryRectangle

isBaseLayer()​

isBaseLayer(): boolean;

Gets a value indicating whether this layer is the base layer in the ImageryLayerCollection. The base layer is the one that underlies all others. It is special in that it is treated as if it has global rectangle, even if it actually does not, by stretching the texels at the edges over the entire globe.

Returns​

boolean

true if this is the base layer; otherwise, false.

Inherited from​

ImageryLayer.isBaseLayer

isDestroyed()​

isDestroyed(): boolean;

Returns true if this object was destroyed; otherwise, false.



If this object was destroyed, it should not be used; calling any function other than isDestroyed will result in a DeveloperError exception.

Returns​

boolean

True if this object was destroyed; otherwise, false.

Inherited from​

ImageryLayer.isDestroyed

softRefreshCurrentView()​

softRefreshCurrentView(): void;

Invalidates the imagery currently visible without destroying the provider.

Returns​

void

Remarks​

The layer is removed and reinserted at the same collection index. Callers normally use updateStyle or updateSelectors instead.


updateSelectors()​

updateSelectors(selectors): void;

Replaces dimension selections and refreshes visible tiles when they change.

Parameters​

ParameterTypeDescription
selectorsRecord<string, ZarrSelectorsProps>Selectors keyed by normalized dimension name.

Returns​

void


updateStyle()​

updateStyle(options): void;

Updates rendering style and refreshes visible tiles when pixel colors change.

Parameters​

ParameterTypeDescription
options{ colormap?: string; opacity?: number; scale?: [number, number]; }Partial style update. opacity updates Cesium layer alpha; scale and colormap update the shared tile renderer.
options.colormap?string-
options.opacity?number-
options.scale?[number, number]-

Returns​

void


fromProviderAsync()​

static fromProviderAsync(imageryProviderPromise, options?): ImageryLayer;

Create a new imagery layer from an asynchronous imagery provider. The layer will handle any asynchronous loads or errors, and begin rendering the imagery layer once ready.

Parameters​

ParameterTypeDescription
imageryProviderPromisePromise<ImageryProvider>A promise which resolves to a imagery provider
options?ConstructorOptionsAn object describing initialization options

Returns​

ImageryLayer

The created imagery layer.

Examples​

// Create a new base layer
const viewer = new Cesium.Viewer("cesiumContainer", {
baseLayer: Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812));
});
// Add a new transparent layer
const imageryLayer = Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812));
imageryLayer.alpha = 0.5;
viewer.imageryLayers.add(imageryLayer);
// Handle loading events
const imageryLayer = Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812));
viewer.imageryLayers.add(imageryLayer);

imageryLayer.readyEvent.addEventListener(provider => {
imageryLayer.imageryProvider.errorEvent.addEventListener(error => {
alert(`Encountered an error while loading imagery tiles! ${error}`);
});
});

imageryLayer.errorEvent.addEventListener(error => {
alert(`Encountered an error while creating an imagery layer! ${error}`);
});

Inherited from​

ImageryLayer.fromProviderAsync

fromWorldImagery()​

static fromWorldImagery(options): ImageryLayer;

Create a new imagery layer for ion's default global base imagery layer, currently Bing Maps. The layer will handle any asynchronous loads or errors, and begin rendering the imagery layer once ready.

Parameters​

ParameterTypeDescription
optionsConstructorOptionsAn object describing initialization options

Returns​

ImageryLayer

The created imagery layer.

Examples​

// Add a new transparent layer
const imageryLayer = Cesium.ImageryLayer.fromWorldImagery();
imageryLayer.alpha = 0.5;
viewer.imageryLayers.add(imageryLayer);
// Handle loading events
const imageryLayer = Cesium.ImageryLayer.fromWorldImagery();
viewer.imageryLayers.add(imageryLayer);

imageryLayer.readyEvent.addEventListener(provider => {
imageryLayer.imageryProvider.errorEvent.addEventListener(error => {
alert(`Encountered an error while loading imagery tiles! ${error}`);
});
});

imageryLayer.errorEvent.addEventListener(error => {
alert(`Encountered an error while creating an imagery layer! ${error}`);
});
// Create a new base layer
const viewer = new Cesium.Viewer("cesiumContainer", {
baseLayer: Cesium.ImageryLayer.fromWorldImagery();
});

Inherited from​

ImageryLayer.fromWorldImagery

Properties​

alpha​

alpha: number;

The alpha blending value of this layer, with 0.0 representing fully transparent and 1.0 representing fully opaque.

Inherited from​

ImageryLayer.alpha

brightness​

brightness: number;

The brightness of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 makes the imagery darker while greater than 1.0 makes it brighter.

Inherited from​

ImageryLayer.brightness

colorToAlpha​

colorToAlpha: Color;

Color value that should be set to transparent.

Inherited from​

ImageryLayer.colorToAlpha

colorToAlphaThreshold​

colorToAlphaThreshold: number;

Normalized (0-1) threshold for color-to-alpha.

Inherited from​

ImageryLayer.colorToAlphaThreshold

contrast​

contrast: number;

The contrast of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the contrast while greater than 1.0 increases it.

Inherited from​

ImageryLayer.contrast

cutoutRectangle​

cutoutRectangle: Rectangle;

Rectangle cutout in this layer of imagery.

Inherited from​

ImageryLayer.cutoutRectangle

dayAlpha​

dayAlpha: number;

The alpha blending value of this layer on the day side of the globe, with 0.0 representing fully transparent and 1.0 representing fully opaque. This only takes effect when Globe#enableLighting is true.

Inherited from​

ImageryLayer.dayAlpha

errorEvent​

readonly errorEvent: Event<ErrorEventCallback>;

Gets an event that is raised when the imagery provider encounters an asynchronous error. By subscribing to the event, you will be notified of the error and can potentially recover from it. Event listeners are passed an instance of the thrown error.

Inherited from​

ImageryLayer.errorEvent

gamma​

gamma: number;

The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color.

Inherited from​

ImageryLayer.gamma

hue​

hue: number;

The hue of this layer in radians. 0.0 uses the unmodified imagery color.

Inherited from​

ImageryLayer.hue

id​

id: string = '';

Application-defined identifier; Cesium does not assign this automatically.


imageryProvider​

imageryProvider: ZarrLayerProvider;

Strongly typed Zarr imagery provider associated with this layer.

Overrides​

ImageryLayer.imageryProvider

magnificationFilter​

magnificationFilter: TextureMagnificationFilter;

The TextureMagnificationFilter to apply to this layer. Possible values are TextureMagnificationFilter.LINEAR (the default) and TextureMagnificationFilter.NEAREST.

To take effect, this property must be set immediately after adding the imagery layer. Once a texture is loaded it won't be possible to change the texture filter used.

Inherited from​

ImageryLayer.magnificationFilter

minificationFilter​

minificationFilter: TextureMinificationFilter;

The TextureMinificationFilter to apply to this layer. Possible values are TextureMinificationFilter.LINEAR (the default) and TextureMinificationFilter.NEAREST.

To take effect, this property must be set immediately after adding the imagery layer. Once a texture is loaded it won't be possible to change the texture filter used.

Inherited from​

ImageryLayer.minificationFilter

nightAlpha​

nightAlpha: number;

The alpha blending value of this layer on the night side of the globe, with 0.0 representing fully transparent and 1.0 representing fully opaque. This only takes effect when Globe#enableLighting is true.

Inherited from​

ImageryLayer.nightAlpha

ready​

readonly ready: boolean;

Returns true when the terrain provider has been successfully created. Otherwise, returns false.

Inherited from​

ImageryLayer.ready

readyEvent​

readonly readyEvent: Event<ReadyEventCallback>;

Gets an event that is raised when the imagery provider has been successfully created. Event listeners are passed the created instance of ImageryProvider.

Inherited from​

ImageryLayer.readyEvent

rectangle​

readonly rectangle: Rectangle;

Gets the rectangle of this layer. If this rectangle is smaller than the rectangle of the ImageryProvider, only a portion of the imagery provider is shown.

Inherited from​

ImageryLayer.rectangle

saturation​

saturation: number;

The saturation of this layer. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the saturation while greater than 1.0 increases it.

Inherited from​

ImageryLayer.saturation

show​

show: boolean;

Determines if this layer is shown.

Inherited from​

ImageryLayer.show

splitDirection​

splitDirection: SplitDirection;

The SplitDirection to apply to this layer.

Inherited from​

ImageryLayer.splitDirection

viewer?​

optional viewer: CesiumHost;

Viewer or widget used to request a render after runtime updates.


DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD​

static DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD: number;

This value is used as the default threshold for color-to-alpha if one is not provided during construction or by the imagery provider.

Inherited from​

ImageryLayer.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD

DEFAULT_BRIGHTNESS​

static DEFAULT_BRIGHTNESS: number;

This value is used as the default brightness for the imagery layer if one is not provided during construction or by the imagery provider. This value does not modify the brightness of the imagery.

Inherited from​

ImageryLayer.DEFAULT_BRIGHTNESS

DEFAULT_CONTRAST​

static DEFAULT_CONTRAST: number;

This value is used as the default contrast for the imagery layer if one is not provided during construction or by the imagery provider. This value does not modify the contrast of the imagery.

Inherited from​

ImageryLayer.DEFAULT_CONTRAST

DEFAULT_GAMMA​

static DEFAULT_GAMMA: number;

This value is used as the default gamma for the imagery layer if one is not provided during construction or by the imagery provider. This value does not modify the gamma of the imagery.

Inherited from​

ImageryLayer.DEFAULT_GAMMA

DEFAULT_HUE​

static DEFAULT_HUE: number;

This value is used as the default hue for the imagery layer if one is not provided during construction or by the imagery provider. This value does not modify the hue of the imagery.

Inherited from​

ImageryLayer.DEFAULT_HUE

DEFAULT_MAGNIFICATION_FILTER​

static DEFAULT_MAGNIFICATION_FILTER: TextureMagnificationFilter;

This value is used as the default texture magnification filter for the imagery layer if one is not provided during construction or by the imagery provider.

Inherited from​

ImageryLayer.DEFAULT_MAGNIFICATION_FILTER

DEFAULT_MINIFICATION_FILTER​

static DEFAULT_MINIFICATION_FILTER: TextureMinificationFilter;

This value is used as the default texture minification filter for the imagery layer if one is not provided during construction or by the imagery provider.

Inherited from​

ImageryLayer.DEFAULT_MINIFICATION_FILTER

DEFAULT_SATURATION​

static DEFAULT_SATURATION: number;

This value is used as the default saturation for the imagery layer if one is not provided during construction or by the imagery provider. This value does not modify the saturation of the imagery.

Inherited from​

ImageryLayer.DEFAULT_SATURATION

DEFAULT_SPLIT​

static DEFAULT_SPLIT: SplitDirection;

This value is used as the default split for the imagery layer if one is not provided during construction or by the imagery provider.

Inherited from​

ImageryLayer.DEFAULT_SPLIT