---
title: "CommonShapeLayerOptions | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Type Alias CommonShapeLayerOptions

type CommonShapeLayerOptions \= {  
    [beforeId](#beforeid)?: string;  
    [data](#data): [FeatureCollection](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.FeatureCollection/) | string;  
    [layerId](#layerid)?: string;  
    [maxzoom](#maxzoom)?: number;  
    [minzoom](#minzoom)?: number;  
    [outline](#outline)?: boolean;  
    [outlineColor](#outlinecolor)?: string | [ZoomStringValues](https://docs.maptiler.com/sdk-js/api-reference/types/ZoomStringValues/);  
    [outlineOpacity](#outlineopacity)?: number | [ZoomNumberValues](https://docs.maptiler.com/sdk-js/api-reference/types/ZoomNumberValues/);  
    [outlineWidth](#outlinewidth)?: number | [ZoomNumberValues](https://docs.maptiler.com/sdk-js/api-reference/types/ZoomNumberValues/);  
    [sourceId](#sourceid)?: string;  
}

##### Index

### Properties[](#properties)

[beforeId?](#beforeid) [data](#data) [layerId?](#layerid) [maxzoom?](#maxzoom) [minzoom?](#minzoom) [outline?](#outline) [outlineColor?](#outlinecolor) [outlineOpacity?](#outlineopacity) [outlineWidth?](#outlinewidth) [sourceId?](#sourceid)

## Properties[](#properties-1)

### `Optional`beforeId[](#beforeid)

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[](#data)

data: [FeatureCollection](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.FeatureCollection/) | string

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

### `Optional`layerId[](#layerid)

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.

### `Optional`maxzoom[](#maxzoom)

maxzoom?: number

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

### `Optional`minzoom[](#minzoom)

minzoom?: number

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

### `Optional`outline[](#outline)

outline?: boolean

Whether or not to add an outline. Default: `false`

### `Optional`outlineColor[](#outlinecolor)

outlineColor?: string | [ZoomStringValues](https://docs.maptiler.com/sdk-js/api-reference/types/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`

### `Optional`outlineOpacity[](#outlineopacity)

outlineOpacity?: number | [ZoomNumberValues](https://docs.maptiler.com/sdk-js/api-reference/types/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`

### `Optional`outlineWidth[](#outlinewidth)

outlineWidth?: number | [ZoomNumberValues](https://docs.maptiler.com/sdk-js/api-reference/types/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`

### `Optional`sourceId[](#sourceid)

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.
