Style for raster layers.

For more information on how to style raster layers, see Learn how to visualize and style raster data using a RasterTileSetLayer.

Hierarchy

  • RasterStyle

Properties

alpha?: number

A number with an opacity value between 0 and 1. 0 is fully transparent t, 1 is fully opaque. By default, the value is 1.

Default

1
brightness?: number

Sets the brightness.

The brightness is a value between 0 and 2. A value of 1 (the default) leaves the brightness unchanged. Values larger than 1 makes the colors brighter, while a value smaller than 1 makes the colors less bright. A value of 0 will make the raster black, while a value of 2 will make it fully white.

This is only supported on WebGL maps.

Default

1.

Since

2023.1

contrast?: number

Sets the contrast.

The contrast is a value between 0 and 2. A value of 1 (the default) leaves the contrast unchanged. A value larger than 1 enhances the contrast of dark colors by making them brighter, while a value smaller than 1 enhances the contrast of bright colors by making them darker.

This is only supported on WebGL maps.

Default

1

Since

2023.1

displacementExpression?: null | Expression<Vector3>

An expression to displace terrain elevation data.

To create expressions, you must use the factory methods in the ExpressionFactory module. The expression must be well-formed and resolve to a point value.

If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than replacing the whole expression.

  // Example of a displacement expression that pushes down everything inside a shape.
var _ = ExpressionFactory;
var shape = _.orientedBox(layer.orientedBox);
rasterStyle.displacementExpression = _.pushDown(shape);

Default

null terrain elevation is not displaced by default.

Since

2020.1

drapeTarget?: DrapeTarget

Determines where the raster is draped on.

This setting is only relevant for 3D maps and is ignored for 2D maps.

Note that there is a technical limitation where you cannot drape the bottom-most imagery 3D Tiles meshes. To work around this limitation, you can add a dummy raster layer underneath the layer you want to drape on meshes. That dummy layer then becomes the bottom-most raster layer. For more information, see Why isn't my data being draped on OGC 3D tiles?.

Default

{@link DrapeTarget.TERRAIN}

See

Since

2022.1

fillStyle?: FillStyle

The fill style used when the raster data extent is shown when zoomed out far.

When this property is undefined, a default red hatched area will be shown. This is to avoid that the raster on the map would be - unintentionally - invisible. Set this property to an empty object literal to turn off the fill.

This setting is only relevant for WebGL maps.

Since

2023.0

lineStyle?: LineStyle

The line style used when the raster data extent is shown when zoomed out far.

When this property is undefined, a default red outline will be shown. This is to avoid that the raster on the map would be - unintentionally - invisible. Set this property to an empty object literal to turn off the outline.

This setting is only relevant for WebGL maps.

Since

2023.0

modulationColor?: string

Sets the color that is modulated with the raster. For example using a raster with gray-scale colors and a red modulation color will result in a resulting painted raster with red hues.

Using a white color has no effect.

The alpha component of this color will be ignored. To control the opacity of the raster use alpha

This is only supported on WebGL maps.

Default

"rgb(255,255,255)"

Since

2023.1