Atlaslog
Atlaslog / MapLibre GL JS / API / setLayoutProperty
MapLibre GL JS · API reference

setLayoutProperty

Quick answer

setLayoutProperty < K extends keyof AllLayoutProperties >( layerId : string , name : K , value : AllLayoutProperties [ K ], options? : StyleSetterOption.

Last verified 2026-11-03 · MapLibre GL JS 4.x · Cite this page
Runnable examplesChinese noteAll API topics
setLayoutProperty()

setLayoutProperty<K extends keyof AllLayoutProperties>(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');

TutorialsAPI index
English reference text adapted from the official MapLibre GL JS documentation, © MapLibre contributors, licensed under BSD-3-Clause.
Original page: https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/ · Chinese note: /maplibre/api/set-layout-property.html
Cite this page

Atlaslog (2026). setLayoutProperty. https://www.jingweizhi.com/en/maplibre/api/set-layout-property.html (accessed 2026-11-03).