addImageryProvider

fun addImageryProvider(imageryProvider: ImageryProvider, index: Int? = definedExternally): ImageryLayer(source)

Creates a new layer using the given ImageryProvider and adds it to the collection.

try {
const provider = await IonImageryProvider.fromAssetId(3812);
scene.imageryLayers.addImageryProvider(provider);
} catch (error) {
console.log(`There was an error creating the imagery layer. ${error}`)
}

Return

The newly created layer.

Parameters

imageryProvider

the imagery provider to create a new layer for.

index

the index to add the layer at. If omitted, the layer will added on top of all existing layers.

See also