setLayoutProperty<
Kextends keyofAllLayoutProperties>(layerId:string,name:K,value:AllLayoutProperties[K],options?:StyleSetterOptions):this
Defined in: ui/map.ts:3732
Sets the value of a layout property in the specified style layer.
Type Parameters
| Type Parameter |
|---|
K extends keyof AllLayoutProperties |
Parameters
| Parameter | Type | Description |
|---|---|---|
layerId |
string |
The ID of the layer to set the layout property in. |
name |
K |
The name of the layout property to set. |
value |
AllLayoutProperties[K] |
The value of the layout property. Must be of a type appropriate for the property, as defined in the MapLibre Style Specification. |
options? |
StyleSetterOptions |
The options object. |
Returns
this
Example
map.setLayoutProperty('my-layer', 'visibility', 'none');