On this page

Type Alias CommonShapeLayerOptions

type CommonShapeLayerOptions = {
    beforeId?: string;
    data: FeatureCollection | string;
    layerId?: string;
    maxzoom?: number;
    minzoom?: number;
    outline?: boolean;
    outlineColor?: string | ZoomStringValues;
    outlineOpacity?: number | ZoomNumberValues;
    outlineWidth?: number | ZoomNumberValues;
    sourceId?: string;
}
Index

Properties

beforeId?: string

The ID of an existing layer to insert the new layer before, resulting in the new layer appearing visually beneath the existing layer. If this argument is not specified, the layer will be appended to the end of the layers array and appear visually above all other layers.

data: FeatureCollection | string

A geojson Feature collection or a URL to a geojson or the UUID of a MapTiler Cloud dataset.

layerId?: string

ID to give to the layer. If not provided, an auto-generated ID of the for "maptiler-layer-xxxxxx" will be auto-generated, with "xxxxxx" being a random string.

maxzoom?: number

Zoom level after which it no longer show. Default: 22

minzoom?: number

Zoom level at which it starts to show. Default: 0

outline?: boolean

Whether or not to add an outline. Default: false

outlineColor?: string | ZoomStringValues

Color of the outline. This is can be a constant color string or a definition based on zoom levels. Applies only if .outline is true. Default: white

outlineOpacity?: number | ZoomNumberValues

Opacity of the outline. This is can be a constant opacity in [0, 1] or a definition based on zoom levels Applies only if .outline is true. Default: 1

outlineWidth?: number | ZoomNumberValues

Width of the outline (relative to screen-space). This is can be a constant width or a definition based on zoom levels. Applies only if .outline is true. Default: 1

sourceId?: string

ID to give to the geojson source. If not provided, an auto-generated ID of the for "maptiler-source-xxxxxx" will be auto-generated, with "xxxxxx" being a random string.

Was this helpful?
SDK JS
Reference
CommonShapeLayerOptions