From c756f546eeee275ebbfe653199d3ff14ec9a9452 Mon Sep 17 00:00:00 2001 From: louwers Date: Mon, 23 Sep 2024 19:35:28 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20maplibre?= =?UTF-8?q?/maplibre-style-spec@947b273521b425e0ca9750fca0bf7e325ee47633?= =?UTF-8?q?=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- search/search_index.json | 2 +- types/index.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/search/search_index.json b/search/search_index.json index d3d87faf2..1b62acc20 100644 --- a/search/search_index.json +++ b/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Introduction","text":"

A MapLibre style is a document that defines the visual appearance of a map: what data to draw, the order to draw it in, and how to style the data when drawing it. A style document is a JSON object with specific root level and nested properties. This specification defines and describes these properties.

The intended audience of this specification includes:

"},{"location":"#style-document-structure","title":"Style document structure","text":"

A MapLibre style consists of a set of root properties, some of which describe a single global property, and some of which contain nested properties. Some root properties, like version, name, and metadata, don\u2019t have any influence over the appearance or behavior of your map, but provide important descriptive information related to your map. Others, like layers and sources, are critical and determine which map features will appear on your map and what they will look like. Some properties, like center, zoom, pitch, and bearing, provide the map renderer with a set of defaults to be used when initially displaying the map.

"},{"location":"deprecations/","title":"Deprecations","text":"

Some style properties are no longer the preferred method of accomplishing a particular styling goal. While they are still supported, it is not recommended to use them in new styles as they may not function as intended when using both deprecated and non-deprecated style properties. The following is provided as reference for users who need to continue maintaining legacy styles while transitioning to preferred style properties. The gl-style-migrate tool can be used to migrate style files to the latest version and replace deprecated expressions with their supported equivalents.

In most cases of deprecated filters you should add a get and literal to convert from old to new syntax, for example [\">=\", \"count\", 5] should be converted to [\">=\", [\"get\", \"count\"], 5] and [\"in\", \"nature\", \"road\", \"highway\"] to [\"in\", [\"get\", \"nature\"], [\"literal\", [\"road\", \"highway\"]]].

"},{"location":"deprecations/#function","title":"Function","text":"

As of v0.41.0, property expressions is the preferred method for styling features based on zoom level or the feature's properties. Zoom and property functions are still supported but are not recommended.

The value for any layout or paint property may be specified as a function. Functions allow you to make the appearance of a map feature change with the current zoom level and/or the feature's properties.

"},{"location":"deprecations/#stops","title":"stops","text":"

Required (except for identity functions) array.

A set of one input value and one output value is a \"stop.\" Stop output values must be literal values (i.e. not functions or expressions), and appropriate for the property. For example, stop output values for a fill-color function property must be colors.

"},{"location":"deprecations/#property","title":"property","text":"

Optional string.

If specified, the function will take the specified feature property as an input. See Zoom Functions and Property Functions for more information.

"},{"location":"deprecations/#base","title":"base","text":"

Optional number. Default is 1.

The exponential base of the interpolation curve. It controls the rate at which the function output increases. Higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.

"},{"location":"deprecations/#type","title":"type","text":"

Optional string. One of identity, exponential, interval, or categorical.

identity: A function that returns its input as the output.

exponential: A function that generates an output by interpolating between stops just less than and just greater than the function input. The domain (input value) must be numeric, and the style property must support interpolation. Style properties that support interpolation are marked marked with, the \"exponential\" symbol, and exponential is the default function type for these properties.

interval: A function that returns the output value of the stop just less than the function input. The domain (input value) must be numeric. Any style property may use interval functions. For properties marked with, the \"interval\" symbol, this is the default function type.

categorical : A function that returns the output value of the stop equal to the function input.

"},{"location":"deprecations/#default","title":"default","text":"

A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:

If no default is provided, the style property's default is used in these circumstances.

"},{"location":"deprecations/#colorspace","title":"colorSpace","text":"

Optional string. One of rgb, lab, hcl.

The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.

rgb: Use the RGB color space to interpolate color values

lab: Use the LAB color space to interpolate color values.

hcl: Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 property 0.18.0 0.18.0 0.18.0 code 0.18.0 5.0.0 5.0.0 exponential type 0.18.0 5.0.0 3.5.0 interval type 0.18.0 5.0.0 3.5.0 categorical type 0.18.0 5.0.0 3.5.0 identity type 0.26.0 5.0.0 3.5.0 default 0.33.0 5.0.0 3.5.0 colorSpace 0.26.0"},{"location":"deprecations/#zoom-and-property-functions","title":"Zoom and Property functions","text":"

Zoom functions allow the appearance of a map feature to change with map\u2019s zoom level. Zoom functions can be used to create the illusion of depth and control data density. Each stop is an array with two elements: the first is a zoom level and the second is a function output value.

{\n    \"circle-radius\": {\n        \"stops\": [\n            // zoom is 5 -> circle radius will be 1px\n            [5, 1],\n            // zoom is 10 -> circle radius will be 2px\n            [10, 2]\n        ]\n    }\n}\n

The rendered values of color, number, and array properties are interpolated between stops. Boolean and string property values cannot be interpolated, so their rendered values only change at the specified stops.

There is an important difference between the way that zoom functions render for layout and paint properties. Paint properties are continuously re-evaluated whenever the zoom level changes, even fractionally. The rendered value of a paint property will change, for example, as the map moves between zoom levels 4.1 and 4.6. Layout properties, however, are evaluated only once for each integer zoom level. To continue the prior example: the rendering of a layout property will not change between zoom levels 4.1 and 4.6, no matter what stops are specified; but at zoom level 5, the function will be re-evaluated according to the function, and the property's rendered value will change. (You can include fractional zoom levels in a layout property zoom function, and it will affect the generated values; but, still, the rendering will only change at integer zoom levels.)

Property functions allow the appearance of a map feature to change with its properties. Property functions can be used to visually differentiate types of features within the same layer or create data visualizations. Each stop is an array with two elements, the first is a property input value and the second is a function output value. Note that support for property functions is not available across all properties and platforms.

{\n    \"circle-color\": {\n        \"property\": \"temperature\",\n        \"stops\": [\n            // \"temperature\" is 0   -> circle color will be blue\n            [0, 'blue'],\n            // \"temperature\" is 100 -> circle color will be red\n            [100, 'red']\n        ]\n    }\n}\n

Zoom-and-property functions allow the appearance of a map feature to change with both its properties and zoom. Each stop is an array with two elements, the first is an object with a property input value and a zoom, and the second is a function output value. Note that support for property functions is not yet complete.

{\n    \"circle-radius\": {\n        \"property\": \"rating\",\n        \"stops\": [\n            // zoom is 0 and \"rating\" is 0 -> circle radius will be 0px\n            [{zoom: 0, value: 0}, 0],\n\n            // zoom is 0 and \"rating\" is 5 -> circle radius will be 5px\n            [{zoom: 0, value: 5}, 5],\n\n            // zoom is 20 and \"rating\" is 0 -> circle radius will be 0px\n            [{zoom: 20, value: 0}, 0],\n\n            // zoom is 20 and \"rating\" is 5 -> circle radius will be 20px\n            [{zoom: 20, value: 5}, 20]\n        ]\n    }\n}\n
"},{"location":"deprecations/#other-filter","title":"Other filter","text":"

In previous versions of the style specification, filters were defined using the deprecated syntax documented below. Though filters defined with this syntax will continue to work, we recommend using the more flexible expressions syntax instead. Expression syntax and the deprecated syntax below cannot be mixed in a single filter definition.

"},{"location":"deprecations/#existential-filters","title":"Existential filters","text":"

[\"has\", key] feature[key] exists

[\"!has\", key] feature[key] does not exist

"},{"location":"deprecations/#comparison-filters","title":"Comparison filters","text":"

[\"==\", key, value] equality: feature[key] = value

[\"!=\", key, value] inequality: feature[key] \u2260 value

[\">\", key, value] greater than: feature[key] > value

[\">=\", key, value] greater than or equal: feature[key] \u2265 value

[\"<\", key, value] less than: feature[key] < value

[\"<=\", key, value] less than or equal: feature[key] \u2264 value

"},{"location":"deprecations/#set-membership-filters","title":"Set membership filters","text":"

[\"in\", key, v0, ..., vn] set inclusion: feature[key] \u2208 {v0, ..., vn}

[\"!in\", key, v0, ..., vn] set exclusion: feature[key] \u2209 { v0, ..., vn}

"},{"location":"deprecations/#combining-filters","title":"Combining filters","text":"

[\"all\", f0, ..., fn] logical AND: f0 \u2227 ... \u2227 fn

[\"any\", f0, ..., fn] logical OR: f0 \u2228 ... \u2228 fn

[\"none\",f0, ...,fn] logical NOR: \u00acf0 \u2227 ... \u2227 \u00acfn

A key must be a string that identifies a feature property, or one of the following special keys:

A value (and v0, ..., vn for set operators) must be a string, number, or boolean to compare the property value against.

Set membership filters are a compact and efficient way to test whether a field matches any of multiple values.

The comparison and set membership filters implement strictly-typed comparisons; for example, all of the following evaluate to false: 0 < \"1\", 2 == \"2\", \"true\" in [true, false].

The \"all\", \"any\", and \"none\" filter operators are used to create compound filters. The values f0, ..., fn must be filter expressions themselves.

[\"==\", \"$type\", \"LineString\"]\n

This filter requires that the class property of each feature is equal to either \"street_major\", \"street_minor\", or \"street_limited\".

[\"in\", \"class\", \"street_major\", \"street_minor\", \"street_limited\"]`\n

The combining filter \"all\" takes the three other filters that follow it and requires all of them to be true for a feature to be included: a feature must have a class equal to \"street_limited\", its admin_level must be greater than or equal to 3, and its type cannot be Polygon. You could change the combining filter to \"any\" to allow features matching any of those criteria to be included - features that are Polygons, but have a different class value, and so on.

[\n    \"all\",\n    [\"==\", \"class\", \"street_limited\"],\n    [\">=\", \"admin_level\", 3],\n    [\"!in\", \"$type\", \"Polygon\"]\n]\n
SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 has / !has 0.19.0 4.1.0 3.3.0"},{"location":"expressions/","title":"Expressions","text":"

The value for any layout property, paint property, or filter property may be specified as an expression. An expression defines a formula for computing the value of the property using the operators described below. The set of expression operators provided by MapLibre includes:

Expressions are represented as JSON arrays. The first element of an expression array is a string naming the expression operator, e.g. \"*\" or \"case\". Elements that follow (if any) are the arguments to the expression. Each argument is either a literal value (a string, number, boolean, or null), or another expression array.

[expression_name, argument_0, argument_1, ...]\n
"},{"location":"expressions/#data-expressions","title":"Data expressions","text":"

A data expression is any expression that access feature data -- that is, any expression that uses one of the data operators: get, has, id, geometry-type, properties, or feature-state. Data expressions allow a feature's properties or state to determine its appearance. They can be used to differentiate features within the same layer and to create data visualizations.

{\n    \"circle-color\": [\n        \"rgb\",\n        // red is higher when feature.properties.temperature is higher\n        [\"get\", \"temperature\"],\n        // green is always zero\n        0,\n        // blue is higher when feature.properties.temperature is lower\n        [\"-\", 100, [\"get\", \"temperature\"]]\n    ]\n}\n

This example uses the get operator to get the temperature value of each feature. That value is used to compute arguments to the rgb operator, defining a color in terms of its red, green, and blue components.

Data expressions are allowed as the value of the filter property, and as values for most paint and layout properties. However, some paint and layout properties do not yet support data expressions. The level of support is indicated by the \"data-driven styling\" row of the \"SDK Support\" table for each property. Data expressions with the feature-state operator are allowed only on paint properties.

"},{"location":"expressions/#camera-expressions","title":"Camera expressions","text":"

A camera expression is any expression that uses the zoom operator. Such expressions allow the appearance of a layer to change with the map's zoom level. Camera expressions can be used to create the appearance of depth and to control data density.

{\n    \"circle-radius\": [\n        \"interpolate\", [\"linear\"], [\"zoom\"],\n        // zoom is 5 (or less) -> circle radius will be 1px\n        5, 1,\n        // zoom is 10 (or greater) -> circle radius will be 5px\n        10, 5\n    ]\n}\n

This example uses the interpolate operator to define a linear relationship between zoom level and circle size using a set of input-output pairs. In this case, the expression indicates that the circle radius should be 1 pixel when the zoom level is 5 or below, and 5 pixels when the zoom is 10 or above. Between the two zoom levels, the circle radius will be linearly interpolated between 1 and 5 pixels

Camera expressions are allowed anywhere an expression may be used. When a camera expression used as the value of a layout or paint property, it must be in one of the following forms:

[ \"interpolate\", interpolation, [\"zoom\"], ... ]\n

Or:

[ \"step\", [\"zoom\"], ... ]\n

Or:

[\n    \"let\",\n    ... variable bindings...,\n    [ \"interpolate\", interpolation, [\"zoom\"], ... ]\n]\n

Or:

[\n    \"let\",\n    ... variable bindings...,\n    [ \"step\", [\"zoom\"], ... ]\n]\n

That is, in layout or paint properties, [\"zoom\"] may appear only as the input to an outer interpolate or step expression, or such an expression within a let expression.

There is an important difference between layout and paint properties in the timing of camera expression evaluation. Paint property camera expressions are re-evaluated whenever the zoom level changes, even fractionally. For example, a paint property camera expression will be re-evaluated continuously as the map moves between zoom levels 4.1 and 4.6. A layout property camera expression is evaluated only at integer zoom levels. It will not be re-evaluated as the zoom changes from 4.1 to 4.6 -- only if it goes above 5 or below 4.

"},{"location":"expressions/#composition","title":"Composition","text":"

A single expression may use a mix of data operators, camera operators, and other operators. Such composite expressions allows a layer's appearance to be determined by a combination of the zoom level and individual feature properties.

{\n    \"circle-radius\": [\n        \"interpolate\", [\"linear\"], [\"zoom\"],\n        // when zoom is 0, set each feature's circle radius to the value of its \"rating\" property\n        0, [\"get\", \"rating\"],\n        // when zoom is 10, set each feature's circle radius to four times the value of its \"rating\" property\n        10, [\"*\", 4, [\"get\", \"rating\"]]\n    ]\n}\n

An expression that uses both data and camera operators is considered both a data expression and a camera expression, and must adhere to the restrictions described above for both.

"},{"location":"expressions/#type-system","title":"Type system","text":"

The input arguments to expressions, and their result values, use the same set of types as the rest of the style specification: boolean, string, number, color, and arrays of these types. Furthermore, expressions are type safe: each use of an expression has a known result type and required argument types, and the SDKs verify that the result type of an expression is appropriate for the context in which it is used. For example, the result type of an expression in the filter property must be boolean, and the arguments to the \"+\" operator must be numbers.

When working with feature data, the type of a feature property value is typically not known ahead of time by the SDK. To preserve type safety, when evaluating a data expression, the SDK will check that the property value is appropriate for the context. For example, if you use the expression [\"get\", \"feature-color\"] for the circle-color property, the SDK will verify that the feature-color value of each feature is a string identifying a valid color. If this check fails, an error will be indicated in an SDK-specific way (typically a log message), and the default value for the property will be used instead.

In most cases, this verification will occur automatically wherever it is needed. However, in certain situations, the SDK may be unable to automatically determine the expected result type of a data expression from surrounding context. For example, it is not clear whether the expression [\"<\", [\"get\", \"a\"], [\"get\", \"b\"]] is attempting to compare strings or numbers. In situations like this, you can use one of the type assertion expression operators to indicate the expected type of a data expression: [\"<\", [\"number\", [\"get\", \"a\"]], [\"number\", [\"get\", \"b\"]]]. A type assertion checks that the feature data matches the expected type of the data expression. If this check fails, it produces an error and causes the whole expression to fall back to the default value for the property being defined. The assertion operators are array, boolean, number, and string.

Expressions perform only one kind of implicit type conversion: a data expression used in a context where a color is expected will convert a string representation of a color to a color value. In all other cases, if you want to convert between types, you must use one of the type conversion expression operators: to-boolean, to-number, to-string, or to-color. For example, if you have a feature property that stores numeric values in string format, and you want to use those values as numbers rather than strings, you can use an expression such as [\"to-number\", [\"get\", \"property-name\"]].

If an expression accepts an array argument and the user supplies an array literal, that array must be wrapped in a literal expression (see the examples below). When GL-JS encounters an array in a style-spec property value, it will assume that the array is an expression and try to parse it; the library has no way to distinguish between an expression which failed validation and an array literal unless the developer makes this distinction explicit with the literal operator. The literal operator is not necessary if the array is returned from a sub-expression, e.g. [\"in\", 1, [\"get\", \"myArrayProp\"]].

// will throw an error\n{\n    \"circle-color\": [\"in\", 1, [1, 2, 3]]\n}\n\n// will work as expected\n{\n    \"circle-color\": [\"in\", 1, [\"literal\", [1, 2, 3]]]\n}\n
"},{"location":"expressions/#variable-binding","title":"Variable binding","text":""},{"location":"expressions/#let","title":"let","text":"

Binds expressions to named variables, which can then be referenced in the result expression using [\"var\", \"variable_name\"].

Syntax:

[\"let\", string, value, expression]: value\n

Example:

\"some-property\": [\n    \"let\",\n    \"someNumber\",\n    500,\n    [\n        \"interpolate\",\n        [\"linear\"],\n        [\"var\", \"someNumber\"],\n        274,\n        \"#edf8e9\",\n        1551,\n        \"#006d2c\"\n    ]\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#var","title":"var","text":"

References variable bound using let.

Syntax:

[\"var\", string]: value\n

Example:

\"some-property\": [\"var\", \"density\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#types","title":"Types","text":""},{"location":"expressions/#literal","title":"literal","text":"

Provides a literal array or object value.

Syntax:

[\"literal\", JSON object or array]: array | object\n

Example:

\"some-property\": [\n    \"literal\",\n    [\"DIN Offc Pro Italic\", \"Arial Unicode MS Regular\"]\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#array","title":"array","text":"

Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.

Syntax:

[\"array\", value, string?, number?]: array\n

Example:

\"some-property\": [\"array\", [\"literal\", [\"a\", \"b\", \"c\"]], \"string\", 3]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#typeof","title":"typeof","text":"

Returns a string describing the type of the given value.

Syntax:

[\"typeof\", value]: string\n

Example:

\"some-property\": [\"typeof\", [\"get\", \"name\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#string","title":"string","text":"

Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.

Syntax:

[\"string\", value, fallback: value, fallback: value, ...]: string\n

Example:

\"some-property\": [\"string\", [\"get\", \"name\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#number","title":"number","text":"

Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.

Syntax:

[\"number\", value, fallback: value, fallback: value, ...]: number\n

Example:

\"some-property\": [\"number\", [\"get\", \"population\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#boolean","title":"boolean","text":"

Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.

Syntax:

[\"boolean\", value, fallback: value, fallback: value, ...]: boolean\n

Example:

\"some-property\": [\"boolean\", [\"feature-state\", \"hover\"], false]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#object","title":"object","text":"

Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.

Syntax:

[\"object\", value, fallback: value, fallback: value, ...]: object\n

Example:

\"some-property\": [\"object\", [\"get\", \"some-property\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#collator","title":"collator","text":"

Returns a collator for use in locale-dependent comparison operations. The case-sensitive and diacritic-sensitive options default to false. The locale argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the collator will use a system-defined fallback locale. Use resolved-locale to test the results of locale fallback behavior.

Syntax:

[\"collator\", collator, { \"case-sensitive\": boolean, \"diacritic-sensitive\": boolean, \"locale\": string }]: collator\n

Example:

\"some-property\": [\n    \"collator\",\n    {\n        \"case-sensitive\": true,\n        \"diacritic-sensitive\": true,\n        \"locale\": \"fr\"\n    }\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.45.0 6.5.0 4.2.0"},{"location":"expressions/#format","title":"format","text":"

Returns a formatted string for displaying mixed-format text in the text-field property. The input may contain a string literal or expression, including an 'image' expression. Strings may be followed by a style override object that supports the following properties:

Syntax:

[\"format\", value, { \"text-font\": string, \"text-color\": color, \"font-scale\": number }, ...]: formatted\n

Example:

\"some-property\": [\n    \"format\",\n    [\"upcase\", [\"get\", \"FacilityName\"]],\n    {\"font-scale\": 0.8},\n    \"\\n\\n\",\n    {},\n    [\"downcase\", [\"get\", \"Comments\"]],\n    {\"font-scale\": 0.6}\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.48.0 6.7.0 4.6.0 text-font 0.48.0 6.7.0 4.6.0 font-scale 0.48.0 6.7.0 4.6.0 text-color 1.3.0 7.3.0 4.10.0 image 1.6.0 8.6.0 5.7.0"},{"location":"expressions/#image","title":"image","text":"

Returns an image type for use in icon-image, *-pattern entries and as a section in the format expression. If set, the image argument will check that the requested image exists in the style and will return either the resolved image name or null, depending on whether or not the image is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the image argument.

Syntax:

[\"image\", value]: image\n

Example:

\"some-property\": [\"image\", \"marker_15\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 1.4.0 8.6.0 5.7.0"},{"location":"expressions/#number-format","title":"number-format","text":"

Converts the input number into a string representation using the providing formatting rules. If set, the locale argument specifies the locale to use, as a BCP 47 language tag. If set, the currency argument specifies an ISO 4217 code to use for currency-style formatting. If set, the min-fraction-digits and max-fraction-digits arguments specify the minimum and maximum number of fractional digits to include.

Syntax:

[\"number-format\", number, { \"locale\": string, \"currency\": string, \"min-fraction-digits\": number, \"max-fraction-digits\": number }]: string\n

Example:

\"some-property\": [\n    \"number-format\",\n    [\"get\", \"mag\"],\n    {\"min-fraction-digits\": 1, \"max-fraction-digits\": 1}\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.54.0 8.4.0 \u2705"},{"location":"expressions/#to-string","title":"to-string","text":"

Converts the input value to a string. If the input is null, the result is \"\". If the input is a boolean, the result is \"true\" or \"false\". If the input is a number, it is converted to a string as specified by the \"NumberToString\" algorithm of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form \"rgba(r,g,b,a)\", where r, g, and b are numerals ranging from 0 to 255, and a ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the JSON.stringify function of the ECMAScript Language Specification.

Syntax:

[\"to-string\", value]: string\n

Example:

\"some-property\": [\"to-string\", [\"get\", \"mag\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#to-number","title":"to-number","text":"

Converts the input value to a number, if possible. If the input is null or false, the result is 0. If the input is true, the result is 1. If the input is a string, it is converted to a number as specified by the \"ToNumber Applied to the String Type\" algorithm of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.

Syntax:

[\"to-number\", value, fallback: value, fallback: value, ...]: number\n

Example:

\"some-property\": [\"to-number\", \"someProperty\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#to-boolean","title":"to-boolean","text":"

Converts the input value to a boolean. The result is false when then input is an empty string, 0, false, null, or NaN; otherwise it is true.

Syntax:

[\"to-boolean\", value]: boolean\n

Example:

\"some-property\": [\"to-boolean\", \"someProperty\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#to-color","title":"to-color","text":"

Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.

Syntax:

[\"to-color\", value, fallback: value, fallback: value, ...]: color\n

Example:

\"some-property\": [\"to-color\", \"#edf8e9\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#lookup","title":"Lookup","text":""},{"location":"expressions/#at","title":"at","text":"

Retrieves an item from an array.

Syntax:

[\"at\", number, value]: value\n

Example:

\"some-property\": [\"at\", 1, [\"literal\", [\"a\", \"b\", \"c\"]]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#in","title":"in","text":"

Determines whether an item exists in an array or a substring exists in a string.

Syntax:

[\"in\", value, value]: boolean\n

Example:

\"some-property\": [\"in\", \"$type\", \"Point\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 1.6.0 9.1.0 5.8.0"},{"location":"expressions/#index-of","title":"index-of","text":"

Returns the first position at which an item can be found in an array or a substring can be found in a string, or -1 if the input cannot be found. Accepts an optional index from where to begin the search. In a string, a UTF-16 surrogate pair counts as a single position.

Syntax:

[\"index-of\", value, value, number?]: number\n

Example:

\"some-property\": [\"index-of\", \"foo\", [\"baz\", \"bar\", \"hello\", \"foo\", \"world\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 1.10.0 10.3.0 6.0.0"},{"location":"expressions/#slice","title":"slice","text":"

Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index. In a string, a UTF-16 surrogate pair counts as a single position.

Syntax:

[\"slice\", value, number, number?]: value\n

Example:

\"some-property\": [\"slice\", [\"get\", \"name\"], 0, 3]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 1.10.0 10.3.0 6.0.0"},{"location":"expressions/#get","title":"get","text":"

Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.

Syntax:

[\"get\", string]: value\n

Example:

\"some-property\": [\"get\", \"someProperty\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#has","title":"has","text":"

Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.

Syntax:

[\"has\", string]: boolean\n

Example:

\"some-property\": [\"has\", \"someProperty\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#length","title":"length","text":"

Gets the length of an array or string. In a string, a UTF-16 surrogate pair counts as a single position.

Syntax:

[\"length\", array]: number\n

Example:

\"some-property\": [\"length\", [\"get\", \"myArray\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#decision","title":"Decision","text":""},{"location":"expressions/#case","title":"case","text":"

Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.

Syntax:

[\"case\", value, value, ..., fallback: value]: value\n

Example:

\"some-property\": [\n    \"case\",\n    [\"boolean\", [\"feature-state\", \"hover\"], false],\n    1,\n    0.5\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#match","title":"match","text":"

Selects the output whose label value matches the input value, or the fallback value if no match is found. The input can be any expression (e.g. [\"get\", \"building_type\"]). Each label must be either:

Each label must be unique. If the input type does not match the type of the labels, the result will be the fallback value.

Syntax:

[\"match\", value, value, ..., fallback: value]: value\n

Example:

\"some-property\": [\n    \"match\",\n    [\"get\", \"building_type\"],\n    \"residential\",\n    \"#f00\",\n    \"commercial\",\n    \"#0f0\",\n    \"#000\"\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#coalesce","title":"coalesce","text":"

Evaluates each expression in turn until the first non-null value is obtained, and returns that value.

Syntax:

[\"coalesce\", coalesce, value, fallback]: value\n

Example:

\"some-property\": [\n    \"coalesce\",\n    [\"image\", [\"concat\", [\"get\", \"icon\"], \"_15\"]],\n    [\"image\", \"marker_15\"]\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#_1","title":"==","text":"

Returns true if the input values are equal, false otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional collator argument to control locale-dependent string comparisons.

Syntax:

[\"==\", value, value, collator?]: boolean\n

Example:

\"some-property\": [\"==\", \"$type\", \"Polygon\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0 collator 0.45.0 6.5.0 4.2.0"},{"location":"expressions/#_2","title":"!=","text":"

Returns true if the input values are not equal, false otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional collator argument to control locale-dependent string comparisons.

Syntax:

[\"!=\", value, value, collator?]: boolean\n

Example:

\"some-property\": [\"!=\", \"cluster\", true]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0 collator 0.45.0 6.5.0 4.2.0"},{"location":"expressions/#_3","title":">","text":"

Returns true if the first input is strictly greater than the second, false otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional collator argument to control locale-dependent string comparisons.

Syntax:

[\">\", value, value, collator?]: boolean\n

Example:

\"some-property\": [\">\", [\"get\", \"mag\"], 2]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0 collator 0.45.0 6.5.0 4.2.0"},{"location":"expressions/#_4","title":"<","text":"

Returns true if the first input is strictly less than the second, false otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional collator argument to control locale-dependent string comparisons.

Syntax:

[\"<\", value, value, collator?]: boolean\n

Example:

\"some-property\": [\"<\", [\"get\", \"mag\"], 2]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0 collator 0.45.0 6.5.0 4.2.0"},{"location":"expressions/#_5","title":">=","text":"

Returns true if the first input is greater than or equal to the second, false otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional collator argument to control locale-dependent string comparisons.

Syntax:

[\">=\", value, value, collator?]: boolean\n

Example:

\"some-property\": [\">=\", [\"get\", \"mag\"], 6]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0 collator 0.45.0 6.5.0 4.2.0"},{"location":"expressions/#_6","title":"<=","text":"

Returns true if the first input is less than or equal to the second, false otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional collator argument to control locale-dependent string comparisons.

Syntax:

[\"<=\", value, value, collator?]: boolean\n

Example:

\"some-property\": [\"<=\", [\"get\", \"mag\"], 6]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0 collator 0.45.0 6.5.0 4.2.0"},{"location":"expressions/#all","title":"all","text":"

Returns true if all the inputs are true, false otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to false, the result is false and no further input expressions are evaluated.

Syntax:

[\"all\", boolean, boolean, ...]: boolean\n

Example:

\"some-property\": [\"all\", [\">=\", [\"get\", \"mag\"], 4], [\"<\", [\"get\", \"mag\"], 5]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#any","title":"any","text":"

Returns true if any of the inputs are true, false otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to true, the result is true and no further input expressions are evaluated.

Syntax:

[\"any\", boolean, boolean, ...]: boolean\n

Example:

\"some-property\": [\"any\", [\">=\", [\"get\", \"mag\"], 4], [\"<\", [\"get\", \"mag\"], 5]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#_7","title":"!","text":"

Logical negation. Returns true if the input is false, and false if the input is true.

Syntax:

[\"!\", value, value, collator?]: boolean\n

Example:

\"some-property\": [\"!\", [\"has\", \"point_count\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#within","title":"within","text":"

Returns true if the evaluated feature is fully contained inside a boundary of the input geometry, false otherwise. The input value can be a valid GeoJSON of type Polygon, MultiPolygon, Feature, or FeatureCollection. Supported features for evaluation:

Syntax:

[\"within\", GeoJSON geometry]: boolean\n

Example:

\"some-property\": [\n    \"within\",\n    {\n        \"type\": \"Polygon\",\n        \"coordinates\": [\n            [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]\n        ]\n    }\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 1.9.0 9.1.0 5.8.0"},{"location":"expressions/#ramps-scales-curves","title":"Ramps, scales, curves","text":""},{"location":"expressions/#step","title":"step","text":"

Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values (\"stops\"). The input may be any numeric expression (e.g., [\"get\", \"population\"]). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.

Syntax:

[\"step\", step, number, number, number, ...]: number\n

Example:

\"some-property\": [\"step\", [\"get\", \"point_count\"], 20, 100, 30, 750, 40]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.42.0 6.0.0 4.0.0"},{"location":"expressions/#interpolate","title":"interpolate","text":"

Produces continuous, smooth results by interpolating between pairs of input and output values (\"stops\"). The input may be any numeric expression (e.g., [\"get\", \"population\"]). Stop inputs must be numeric literals in strictly ascending order. The output type must be number, array<number>, or color.

Interpolation types:

Syntax:

[\"interpolate\", [\"linear\"] | [\"exponential\", base] | [\"cubic-bezier\", x1, y1, x2, y2], number, number, number, ...]: number | array<number> | color\n

Example:

\"some-property\": [\n    \"interpolate\",\n    [\"linear\"],\n    [\"zoom\"],\n    15,\n    0,\n    15.05,\n    [\"get\", \"height\"]\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.42.0 6.0.0 4.0.0"},{"location":"expressions/#interpolate-hcl","title":"interpolate-hcl","text":"

Produces continuous, smooth results by interpolating between pairs of input and output values (\"stops\"). Works like interpolate, but the output type must be color, and the interpolation is performed in the Hue-Chroma-Luminance color space.

Syntax:

[\"interpolate-hcl\", [\"linear\"] | [\"exponential\", base] | [\"cubic-bezier\", x1, y1, x2, y2], number, number, number, ...]: color\n

Example:

\"some-property\": [\n    \"interpolate-hcl\",\n    [\"linear\"],\n    [\"zoom\"],\n    15,\n    \"#f00\",\n    15.05,\n    \"#00f\"\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.49.0 \u274c (#2784) \u274c (#2784)"},{"location":"expressions/#interpolate-lab","title":"interpolate-lab","text":"

Produces continuous, smooth results by interpolating between pairs of input and output values (\"stops\"). Works like interpolate, but the output type must be color, and the interpolation is performed in the CIELAB color space.

Syntax:

[\"interpolate-lab\", [\"linear\"] | [\"exponential\", base] | [\"cubic-bezier\", x1, y1, x2, y2], number, number, number, ...]: color\n

Example:

\"some-property\": [\n    \"interpolate-lab\",\n    [\"linear\"],\n    [\"zoom\"],\n    15,\n    \"#f00\",\n    15.05,\n    \"#00f\"\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.49.0 \u274c (#2784) \u274c (#2784)"},{"location":"expressions/#math","title":"Math","text":""},{"location":"expressions/#ln2","title":"ln2","text":"

Returns mathematical constant ln(2).

Syntax:

[\"ln2\"]: number\n

Example:

\"some-property\": [\"ln2\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#pi","title":"pi","text":"

Returns the mathematical constant pi.

Syntax:

[\"pi\"]: number\n

Example:

\"some-property\": [\"pi\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#e","title":"e","text":"

Returns the mathematical constant e.

Syntax:

[\"e\"]: number\n

Example:

\"some-property\": [\"e\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#_8","title":"+","text":"

Returns the sum of the inputs.

Syntax:

[\"+\", number, number, ...]: number\n

Example:

\"some-property\": [\"+\", 2, 3]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#_9","title":"*","text":"

Returns the product of the inputs.

Syntax:

[\"*\", number, number, ...]: number\n

Example:

\"some-property\": [\"*\", 2, 3]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#-","title":"-","text":"

For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.

Syntax:

[\"-\", number, number?]: number\n

Example:

\"some-property\": [\"-\", 10]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#_10","title":"/","text":"

Returns the result of floating point division of the first input by the second.

Syntax:

[\"/\", number, number]: number\n

Example:

\"some-property\": [\"/\", [\"get\", \"population\"], [\"get\", \"sq-km\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#_11","title":"%","text":"

Returns the remainder after integer division of the first input by the second.

Syntax:

[\"%\", number, number]: number\n

Example:

\"some-property\": [\"%\", 10, 3]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#_12","title":"^","text":"

Returns the result of raising the first input to the power specified by the second.

Syntax:

[\"^\", number, number]: number\n

Example:

\"some-property\": [\"^\", 2, 3]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#sqrt","title":"sqrt","text":"

Returns the square root of the input.

Syntax:

[\"sqrt\", number]: number\n

Example:

\"some-property\": [\"sqrt\", 9]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.42.0 6.0.0 4.0.0"},{"location":"expressions/#log10","title":"log10","text":"

Returns the base-ten logarithm of the input.

Syntax:

[\"log10\", number]: number\n

Example:

\"some-property\": [\"log10\", 8]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#ln","title":"ln","text":"

Returns the natural logarithm of the input.

Syntax:

[\"ln\", number]: number\n

Example:

\"some-property\": [\"ln\", 8]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#log2","title":"log2","text":"

Returns the base-two logarithm of the input.

Syntax:

[\"log2\", number]: number\n

Example:

\"some-property\": [\"log2\", 8]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#sin","title":"sin","text":"

Returns the sine of the input.

Syntax:

[\"sin\", number]: number\n

Example:

\"some-property\": [\"sin\", 1]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#cos","title":"cos","text":"

Returns the cosine of the input.

Syntax:

[\"cos\", number]: number\n

Example:

\"some-property\": [\"cos\", 1]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#tan","title":"tan","text":"

Returns the tangent of the input.

Syntax:

[\"tan\", number]: number\n

Example:

\"some-property\": [\"tan\", 1]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#asin","title":"asin","text":"

Returns the arcsine of the input.

Syntax:

[\"asin\", number]: number\n

Example:

\"some-property\": [\"asin\", 1]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#acos","title":"acos","text":"

Returns the arccosine of the input.

Syntax:

[\"acos\", number]: number\n

Example:

\"some-property\": [\"acos\", 1]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#atan","title":"atan","text":"

Returns the arctangent of the input.

Syntax:

[\"atan\", number]: number\n

Example:

\"some-property\": [\"atan\", 1]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#min","title":"min","text":"

Returns the minimum value of the inputs.

Syntax:

[\"min\", number, number, ...]: number\n

Example:

\"some-property\": [\"min\", 1, 2]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#max","title":"max","text":"

Returns the maximum value of the inputs.

Syntax:

[\"max\", number, number, ...]: number\n

Example:

\"some-property\": [\"max\", 1, 2]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#round","title":"round","text":"

Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, [\"round\", -1.5] evaluates to -2.

Syntax:

[\"round\", number]: number\n

Example:

\"some-property\": [\"round\", 1.5]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.45.0 6.0.0 4.0.0"},{"location":"expressions/#abs","title":"abs","text":"

Returns the absolute value of the input.

Syntax:

[\"abs\", number]: number\n

Example:

\"some-property\": [\"abs\", -1.5]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.45.0 6.0.0 4.0.0"},{"location":"expressions/#ceil","title":"ceil","text":"

Returns the smallest integer that is greater than or equal to the input.

Syntax:

[\"ceil\", number]: number\n

Example:

\"some-property\": [\"ceil\", 1.5]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.45.0 6.0.0 4.0.0"},{"location":"expressions/#floor","title":"floor","text":"

Returns the largest integer that is less than or equal to the input.

Syntax:

[\"floor\", number]: number\n

Example:

\"some-property\": [\"floor\", 1.5]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.45.0 6.0.0 4.0.0"},{"location":"expressions/#distance","title":"distance","text":"

Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, Feature, or FeatureCollection. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.

Syntax:

[\"distance\", GeoJSON geometry]: number\n

Example:

\"some-property\": [\"distance\", {\"type\": \"Point\", \"coordinates\": [0, 0]}]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 4.2.0 9.2.0 5.9.0"},{"location":"expressions/#color","title":"Color","text":""},{"location":"expressions/#to-rgba","title":"to-rgba","text":"

Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.

Syntax:

[\"to-rgba\", color]: array\n

Example:

\"some-property\": [\"to-rgba\", \"#ff0000\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#rgb","title":"rgb","text":"

Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.

Syntax:

[\"rgb\", number, number, number]: color\n

Example:

\"some-property\": [\"rgb\", 255, 0, 0]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#rgba","title":"rgba","text":"

Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.

Syntax:

[\"rgba\", number, number, number, number]: color\n

Example:

\"some-property\": [\"rgba\", 255, 0, 0, 1]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#feature-data","title":"Feature data","text":""},{"location":"expressions/#properties","title":"properties","text":"

Gets the feature properties object. Note that in some cases, it may be more efficient to use [\"get\", \"property_name\"] directly.

Syntax:

[\"properties\"]: value\n

Example:

\"some-property\": [\"properties\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#feature-state","title":"feature-state","text":"

Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. When source.promoteId is not provided, features are identified by their id attribute, which must be an integer or a string that can be cast to an integer. When source.promoteId is provided, features are identified by their promoteId property, which may be a number, string, or any primitive data type. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.

Syntax:

[\"feature-state\", string]: value\n

Example:

\"some-property\": [\"feature-state\", \"hover\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.46.0 \u274c (#1698) \u274c (#1698)"},{"location":"expressions/#geometry-type","title":"geometry-type","text":"

Gets the feature's geometry type: Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon.

Syntax:

[\"geometry-type\"]: string\n

Example:

\"some-property\": [\"==\", [\"geometry-type\"], \"Polygon\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#id","title":"id","text":"

Gets the feature's id, if it has one.

Syntax:

[\"id\"]: value\n

Example:

\"some-property\": [\"id\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#line-progress","title":"line-progress","text":"

Gets the progress along a gradient line. Can only be used in the line-gradient property.

Syntax:

[\"line-progress\", number]: number\n

Example:

\"some-property\": [\"line-progress\", 0.5]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.45.0 6.5.0 4.6.0"},{"location":"expressions/#accumulated","title":"accumulated","text":"

Gets the value of a cluster property accumulated so far. Can only be used in the clusterProperties option of a clustered GeoJSON source.

Syntax:

[\"accumulated\", string]: value\n

Example:

\"some-property\": [\"accumulated\", \"sum\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.53.0 \u2705 \u2705"},{"location":"expressions/#zoom","title":"Zoom","text":""},{"location":"expressions/#zoom_1","title":"zoom","text":"

Gets the current zoom level. Note that in style layout and paint properties, [\"zoom\"] may only appear as the input to a top-level \"step\" or \"interpolate\" expression.

Syntax:

[\"zoom\"]: number\n

Example:

\"some-property\": [\n    \"interpolate\",\n    [\"linear\"],\n    [\"zoom\"],\n    15,\n    0,\n    15.05,\n    [\"get\", \"height\"]\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#heatmap","title":"Heatmap","text":""},{"location":"expressions/#heatmap-density","title":"heatmap-density","text":"

Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the heatmap-color property.

Syntax:

[\"heatmap-density\"]: number\n

Example:

\"some-property\": [\"heatmap-density\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#string_1","title":"String","text":""},{"location":"expressions/#is-supported-script","title":"is-supported-script","text":"

Returns true if the input string is expected to render legibly. Returns false if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the mapbox-gl-rtl-text plugin is not in use in MapLibre GL JS).

Syntax:

[\"is-supported-script\", string]: boolean\n

Example:

\"some-property\": [\"is-supported-script\", \"\u0926\u093f\u0932\u094d\u0932\u0940\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.45.0 6.6.0 \u2705"},{"location":"expressions/#upcase","title":"upcase","text":"

Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.

Syntax:

[\"upcase\", string]: string\n

Example:

\"some-property\": [\"upcase\", [\"get\", \"name\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#downcase","title":"downcase","text":"

Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.

Syntax:

[\"downcase\", string]: string\n

Example:

\"some-property\": [\"downcase\", [\"get\", \"name\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#concat","title":"concat","text":"

Returns a string consisting of the concatenation of the inputs. Each input is converted to a string as if by to-string.

Syntax:

[\"concat\", string, string, ...]: string\n

Example:

\"some-property\": [\"concat\", \"square-rgb-\", [\"get\", \"color\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#resolved-locale","title":"resolved-locale","text":"

Returns the IETF language tag of the locale being used by the provided collator. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.

Syntax:

[\"resolved-locale\", collator]: string\n

Example:

\"some-property\": [\n    \"resolved-locale\",\n    [\n        \"collator\",\n        {\n            \"case-sensitive\": true,\n            \"diacritic-sensitive\": false,\n            \"locale\": \"de\"\n        }\n    ]\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.45.0 6.5.0 4.2.0"},{"location":"glyphs/","title":"Glyphs","text":"

A URL template for loading signed-distance-field glyph sets in PBF format.

The URL must include:

This property is required if any layer uses the text-field layout property. The URL must be absolute, containing the scheme, authority and path components.

glyphs: \"https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf\"\n
"},{"location":"layers/","title":"Layers","text":"

A style's layers property lists all the layers available in that style. The type of layer is specified by the type property, and must be one of background, fill, line, symbol, raster, circle, fill-extrusion, heatmap, hillshade.

Except for layers of the background type, each layer needs to refer to a source. Layers take the data that they get from a source, optionally filter features, and then define how those features are styled.

layers: [\n    {\n        \"id\": \"coastline\",\n        \"source\": \"maplibre\",\n        \"source-layer\": \"contries\",\n        \"type\": \"line\",\n        \"paint\": {\"line-color\": \"#198EC8\"}\n    }\n]\n
"},{"location":"layers/#layer-properties","title":"Layer Properties","text":""},{"location":"layers/#id","title":"id","text":"

Required string.

Unique layer name.

"},{"location":"layers/#type","title":"type","text":"

Required enum. Possible values: fill, line, symbol, circle, heatmap, fill-extrusion, raster, hillshade, background.

Rendering type of this layer.

"},{"location":"layers/#metadata","title":"metadata","text":"

Optional.

Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'maplibre:'.

metadata: {\"source:comment\": \"Hydrology FCCODE 460 - Narrow wash\"}\n
"},{"location":"layers/#source","title":"source","text":"

Optional string.

Name of a source description to be used for this layer. Required for all layer types except background.

"},{"location":"layers/#source-layer","title":"source-layer","text":"

Optional string.

Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.

"},{"location":"layers/#minzoom","title":"minzoom","text":"

Optional number in range [0, 24].

The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden.

"},{"location":"layers/#maxzoom","title":"maxzoom","text":"

Optional number in range [0, 24].

The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden.

"},{"location":"layers/#filter","title":"filter","text":"

Optional filter.

A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The feature-state expression is not supported in filter expressions.

"},{"location":"layers/#layout","title":"layout","text":"

Optional layout.

Layout properties for the layer.

"},{"location":"layers/#paint","title":"paint","text":"

Optional paint.

Default paint properties for this layer.

"},{"location":"layers/#background","title":"Background","text":""},{"location":"layers/#visibility","title":"visibility","text":"

Layout property. Optional enum. Possible values: visible, none. Defaults to visible.

Whether this layer is displayed.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#background-color","title":"background-color","text":"

Paint property. Optional color. Defaults to #000000. Disabled by background-pattern. Supports interpolate expressions. Transitionable.

The color with which the background will be drawn.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#background-pattern","title":"background-pattern","text":"

Paint property. Optional resolvedImage. Transitionable.

Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling Not supported yet Not supported yet Not supported yet"},{"location":"layers/#background-opacity","title":"background-opacity","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Supports interpolate expressions. Transitionable.

The opacity at which the background will be drawn.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#fill","title":"Fill","text":""},{"location":"layers/#fill-sort-key","title":"fill-sort-key","text":"

Layout property. Optional number.

Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 1.2.0 9.1.0 5.8.0 data-driven styling 1.2.0 9.1.0 5.8.0"},{"location":"layers/#visibility_1","title":"visibility","text":"

Layout property. Optional enum. Possible values: visible, none. Defaults to visible.

Whether this layer is displayed.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#fill-antialias","title":"fill-antialias","text":"

Paint property. Optional boolean. Defaults to true.

Whether or not the fill should be antialiased.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#fill-opacity","title":"fill-opacity","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Supports feature-state and interpolate expressions. Transitionable.

The opacity of the entire fill layer. In contrast to the fill-color, this value will also affect the 1px stroke around the fill, if the stroke is used.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.21.0 5.0.0 3.5.0"},{"location":"layers/#fill-color","title":"fill-color","text":"

Paint property. Optional color. Defaults to #000000. Disabled by fill-pattern. Supports feature-state and interpolate expressions. Transitionable.

The color of the filled part of this layer. This color can be specified as rgba with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.19.0 5.0.0 3.5.0"},{"location":"layers/#fill-outline-color","title":"fill-outline-color","text":"

Paint property. Optional color. Disabled by fill-pattern. Requires fill-antialias to be true. Supports feature-state and interpolate expressions. Transitionable.

The outline color of the fill. Matches the value of fill-color if unspecified.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.19.0 5.0.0 3.5.0"},{"location":"layers/#fill-translate","title":"fill-translate","text":"

Paint property. Optional array. Units in pixels. Defaults to 0,0. Supports interpolate expressions. Transitionable.

The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#fill-translate-anchor","title":"fill-translate-anchor","text":"

Paint property. Optional enum. Possible values: map, viewport. Defaults to map. Requires fill-translate.

Controls the frame of reference for fill-translate.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#fill-pattern","title":"fill-pattern","text":"

Paint property. Optional resolvedImage. Transitionable.

Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.49.0 6.5.0 4.4.0"},{"location":"layers/#circle","title":"Circle","text":""},{"location":"layers/#circle-sort-key","title":"circle-sort-key","text":"

Layout property. Optional number.

Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 1.2.0 9.2.0 5.9.0 data-driven styling 1.2.0 9.2.0 5.9.0"},{"location":"layers/#visibility_2","title":"visibility","text":"

Layout property. Optional enum. Possible values: visible, none. Defaults to visible.

Whether this layer is displayed.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#circle-radius","title":"circle-radius","text":"

Paint property. Optional number in range [0, \u221e). Units in pixels. Defaults to 5. Supports feature-state and interpolate expressions. Transitionable.

Circle radius.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.18.0 5.0.0 3.5.0"},{"location":"layers/#circle-color","title":"circle-color","text":"

Paint property. Optional color. Defaults to #000000. Supports feature-state and interpolate expressions. Transitionable.

The fill color of the circle.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.18.0 5.0.0 3.5.0"},{"location":"layers/#circle-blur","title":"circle-blur","text":"

Paint property. Optional number. Defaults to 0. Supports feature-state and interpolate expressions. Transitionable.

Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.20.0 5.0.0 3.5.0"},{"location":"layers/#circle-opacity","title":"circle-opacity","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Supports feature-state and interpolate expressions. Transitionable.

The opacity at which the circle will be drawn.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.20.0 5.0.0 3.5.0"},{"location":"layers/#circle-translate","title":"circle-translate","text":"

Paint property. Optional array. Units in pixels. Defaults to 0,0. Supports interpolate expressions. Transitionable.

The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#circle-translate-anchor","title":"circle-translate-anchor","text":"

Paint property. Optional enum. Possible values: map, viewport. Defaults to map. Requires circle-translate.

Controls the frame of reference for circle-translate.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#circle-pitch-scale","title":"circle-pitch-scale","text":"

Paint property. Optional enum. Possible values: map, viewport. Defaults to map.

Controls the scaling behavior of the circle when the map is pitched.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.21.0 4.2.0 3.4.0"},{"location":"layers/#circle-pitch-alignment","title":"circle-pitch-alignment","text":"

Paint property. Optional enum. Possible values: map, viewport. Defaults to viewport.

Orientation of circle when map is pitched.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.39.0 5.2.0 3.7.0"},{"location":"layers/#circle-stroke-width","title":"circle-stroke-width","text":"

Paint property. Optional number in range [0, \u221e). Units in pixels. Defaults to 0. Supports feature-state and interpolate expressions. Transitionable.

The width of the circle's stroke. Strokes are placed outside of the circle-radius.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.29.0 5.0.0 3.5.0 data-driven styling 0.29.0 5.0.0 3.5.0"},{"location":"layers/#circle-stroke-color","title":"circle-stroke-color","text":"

Paint property. Optional color. Defaults to #000000. Supports feature-state and interpolate expressions. Transitionable.

The stroke color of the circle.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.29.0 5.0.0 3.5.0 data-driven styling 0.29.0 5.0.0 3.5.0"},{"location":"layers/#circle-stroke-opacity","title":"circle-stroke-opacity","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Supports feature-state and interpolate expressions. Transitionable.

The opacity of the circle's stroke.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.29.0 5.0.0 3.5.0 data-driven styling 0.29.0 5.0.0 3.5.0"},{"location":"layers/#heatmap","title":"Heatmap","text":""},{"location":"layers/#visibility_3","title":"visibility","text":"

Layout property. Optional enum. Possible values: visible, none. Defaults to visible.

Whether this layer is displayed.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"layers/#heatmap-radius","title":"heatmap-radius","text":"

Paint property. Optional number in range [1, \u221e). Units in pixels. Defaults to 30. Supports feature-state and interpolate expressions. Transitionable.

Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0 data-driven styling 0.43.0 6.0.0 4.0.0"},{"location":"layers/#heatmap-weight","title":"heatmap-weight","text":"

Paint property. Optional number in range [0, \u221e). Defaults to 1. Supports feature-state and interpolate expressions.

A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0 data-driven styling 0.41.0 6.0.0 4.0.0"},{"location":"layers/#heatmap-intensity","title":"heatmap-intensity","text":"

Paint property. Optional number in range [0, \u221e). Defaults to 1. Supports interpolate expressions. Transitionable.

Similar to heatmap-weight but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"layers/#heatmap-color","title":"heatmap-color","text":"

Paint property. Optional color. Defaults to interpolate,linear,heatmap-density,0,rgba(0, 0, 255, 0),0.1,royalblue,0.3,cyan,0.5,lime,0.7,yellow,1,red. Supports interpolate expressions.

Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses [\"heatmap-density\"] as input.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0 data-driven styling Not supported yet Not supported yet Not supported yet"},{"location":"layers/#heatmap-opacity","title":"heatmap-opacity","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Supports interpolate expressions. Transitionable.

The global opacity at which the heatmap layer will be drawn.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"layers/#fill-extrusion","title":"Fill-extrusion","text":""},{"location":"layers/#visibility_4","title":"visibility","text":"

Layout property. Optional enum. Possible values: visible, none. Defaults to visible.

Whether this layer is displayed.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0"},{"location":"layers/#fill-extrusion-opacity","title":"fill-extrusion-opacity","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Supports interpolate expressions. Transitionable.

The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0"},{"location":"layers/#fill-extrusion-color","title":"fill-extrusion-color","text":"

Paint property. Optional color. Defaults to #000000. Disabled by fill-extrusion-pattern. Supports feature-state and interpolate expressions. Transitionable.

The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root light settings. If this color is specified as rgba with an alpha component, the alpha component will be ignored; use fill-extrusion-opacity to set layer opacity.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0 data-driven styling 0.27.0 5.1.0 3.6.0"},{"location":"layers/#fill-extrusion-translate","title":"fill-extrusion-translate","text":"

Paint property. Optional array. Units in pixels. Defaults to 0,0. Supports interpolate expressions. Transitionable.

The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0"},{"location":"layers/#fill-extrusion-translate-anchor","title":"fill-extrusion-translate-anchor","text":"

Paint property. Optional enum. Possible values: map, viewport. Defaults to map. Requires fill-extrusion-translate.

Controls the frame of reference for fill-extrusion-translate.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0"},{"location":"layers/#fill-extrusion-pattern","title":"fill-extrusion-pattern","text":"

Paint property. Optional resolvedImage. Transitionable.

Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0 data-driven styling 0.49.0 6.5.0 4.4.0"},{"location":"layers/#fill-extrusion-height","title":"fill-extrusion-height","text":"

Paint property. Optional number in range [0, \u221e). Units in meters. Defaults to 0. Supports feature-state and interpolate expressions. Transitionable.

The height with which to extrude this layer.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0 data-driven styling 0.27.0 5.1.0 3.6.0"},{"location":"layers/#fill-extrusion-base","title":"fill-extrusion-base","text":"

Paint property. Optional number in range [0, \u221e). Units in meters. Defaults to 0. Requires fill-extrusion-height. Supports feature-state and interpolate expressions. Transitionable.

The height with which to extrude the base of this layer. Must be less than or equal to fill-extrusion-height.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0 data-driven styling 0.27.0 5.1.0 3.6.0"},{"location":"layers/#fill-extrusion-vertical-gradient","title":"fill-extrusion-vertical-gradient","text":"

Paint property. Optional boolean. Defaults to true.

Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.50.0 7.0.0 4.7.0"},{"location":"layers/#line","title":"Line","text":""},{"location":"layers/#line-cap","title":"line-cap","text":"

Layout property. Optional enum. Possible values: butt, round, square. Defaults to butt.

The display of line endings.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#line-join","title":"line-join","text":"

Layout property. Optional enum. Possible values: bevel, round, miter. Defaults to miter.

The display of lines when joining.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.40.0 5.2.0 3.7.0"},{"location":"layers/#line-miter-limit","title":"line-miter-limit","text":"

Layout property. Optional number. Defaults to 2. Requires line-join to be miter. Supports interpolate expressions.

Used to automatically convert miter joins to bevel joins for sharp angles.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#line-round-limit","title":"line-round-limit","text":"

Layout property. Optional number. Defaults to 1.05. Requires line-join to be round. Supports interpolate expressions.

Used to automatically convert round joins to miter joins for shallow angles.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#line-sort-key","title":"line-sort-key","text":"

Layout property. Optional number.

Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 1.2.0 9.1.0 5.8.0 data-driven styling 1.2.0 9.1.0 5.8.0"},{"location":"layers/#visibility_5","title":"visibility","text":"

Layout property. Optional enum. Possible values: visible, none. Defaults to visible.

Whether this layer is displayed.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#line-opacity","title":"line-opacity","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Supports feature-state and interpolate expressions. Transitionable.

The opacity at which the line will be drawn.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.29.0 5.0.0 3.5.0"},{"location":"layers/#line-color","title":"line-color","text":"

Paint property. Optional color. Defaults to #000000. Disabled by line-pattern. Supports feature-state and interpolate expressions. Transitionable.

The color with which the line will be drawn.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.23.0 5.0.0 3.5.0"},{"location":"layers/#line-translate","title":"line-translate","text":"

Paint property. Optional array. Units in pixels. Defaults to 0,0. Supports interpolate expressions. Transitionable.

The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#line-translate-anchor","title":"line-translate-anchor","text":"

Paint property. Optional enum. Possible values: map, viewport. Defaults to map. Requires line-translate.

Controls the frame of reference for line-translate.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#line-width","title":"line-width","text":"

Paint property. Optional number in range [0, \u221e). Units in pixels. Defaults to 1. Supports feature-state and interpolate expressions. Transitionable.

Stroke thickness.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.39.0 5.2.0 3.7.0"},{"location":"layers/#line-gap-width","title":"line-gap-width","text":"

Paint property. Optional number in range [0, \u221e). Units in pixels. Defaults to 0. Supports feature-state and interpolate expressions. Transitionable.

Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.29.0 5.0.0 3.5.0"},{"location":"layers/#line-offset","title":"line-offset","text":"

Paint property. Optional number. Units in pixels. Defaults to 0. Supports feature-state and interpolate expressions. Transitionable.

The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.12.1 3.0.0 3.1.0 data-driven styling 0.29.0 5.0.0 3.5.0"},{"location":"layers/#line-blur","title":"line-blur","text":"

Paint property. Optional number in range [0, \u221e). Units in pixels. Defaults to 0. Supports feature-state and interpolate expressions. Transitionable.

Blur applied to the line, in pixels.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.29.0 5.0.0 3.5.0"},{"location":"layers/#line-dasharray","title":"line-dasharray","text":"

Paint property. Optional array in range [0, \u221e). Units in line widths. Disabled by line-pattern. Transitionable.

Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with lineMetrics: true specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling \u274c (#1235) \u274c (#744) \u274c (#744)"},{"location":"layers/#line-pattern","title":"line-pattern","text":"

Paint property. Optional resolvedImage. Transitionable.

Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.49.0 6.5.0 4.4.0"},{"location":"layers/#line-gradient","title":"line-gradient","text":"

Paint property. Optional color. Disabled by line-dasharray. Disabled by line-pattern. Requires source to be geojson. Supports interpolate expressions.

Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify \"lineMetrics\": true.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.45.0 6.5.0 4.4.0 data-driven styling Not supported yet Not supported yet Not supported yet"},{"location":"layers/#symbol","title":"Symbol","text":""},{"location":"layers/#symbol-placement","title":"symbol-placement","text":"

Layout property. Optional enum. Possible values: point, line, line-center. Defaults to point.

Label placement relative to its geometry.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 line-center value 0.47.0 6.4.0 4.3.0"},{"location":"layers/#symbol-spacing","title":"symbol-spacing","text":"

Layout property. Optional number in range [1, \u221e). Units in pixels. Defaults to 250. Requires symbol-placement to be line. Supports interpolate expressions.

Distance between two symbol anchors.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#symbol-avoid-edges","title":"symbol-avoid-edges","text":"

Layout property. Optional boolean. Defaults to false.

If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like MapLibre GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#symbol-sort-key","title":"symbol-sort-key","text":"

Layout property. Optional number.

Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When icon-allow-overlap or text-allow-overlap is false, features with a lower sort key will have priority during placement. When icon-allow-overlap or text-allow-overlap is set to true, features with a higher sort key will overlap over features with a lower sort key.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.53.0 7.4.0 4.11.0 data-driven styling 0.53.0 7.4.0 4.11.0"},{"location":"layers/#symbol-z-order","title":"symbol-z-order","text":"

Layout property. Optional enum. Possible values: auto, viewport-y, source. Defaults to auto.

Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use symbol-sort-key.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.49.0 6.6.0 4.5.0"},{"location":"layers/#icon-allow-overlap","title":"icon-allow-overlap","text":"

Layout property. Optional boolean. Defaults to false. Requires icon-image. Disabled by icon-overlap.

If true, the icon will be visible even if it collides with other previously drawn symbols.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#icon-overlap","title":"icon-overlap","text":"

Layout property. Optional enum. Possible values: never, always, cooperative. Requires icon-image.

Allows for control over whether to show an icon when it overlaps other symbols on the map. If icon-overlap is not set, icon-allow-overlap is used instead.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 2.1.0 \u274c (#251) \u274c (#251)"},{"location":"layers/#icon-ignore-placement","title":"icon-ignore-placement","text":"

Layout property. Optional boolean. Defaults to false. Requires icon-image.

If true, other symbols can be visible even if they collide with the icon.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#icon-optional","title":"icon-optional","text":"

Layout property. Optional boolean. Defaults to false. Requires icon-image. Requires text-field.

If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#icon-rotation-alignment","title":"icon-rotation-alignment","text":"

Layout property. Optional enum. Possible values: map, viewport, auto. Defaults to auto. Requires icon-image.

In combination with symbol-placement, determines the rotation behavior of icons.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 auto value 0.25.0 4.2.0 3.4.0"},{"location":"layers/#icon-size","title":"icon-size","text":"

Layout property. Optional number in range [0, \u221e). Units in factor of the original icon size. Defaults to 1. Requires icon-image. Supports interpolate expressions.

Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by icon-size. 1 is the original size; 3 triples the size of the image.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.35.0 5.1.0 3.6.0"},{"location":"layers/#icon-text-fit","title":"icon-text-fit","text":"

Layout property. Optional enum. Possible values: none, width, height, both. Defaults to none. Requires icon-image. Requires text-field.

Scales the icon to fit around the associated text.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.21.0 4.2.0 3.4.0 stretchable icons 1.6.0 9.2.0 5.8.0"},{"location":"layers/#icon-text-fit-padding","title":"icon-text-fit-padding","text":"

Layout property. Optional array. Units in pixels. Defaults to 0,0,0,0. Requires icon-image. Requires text-field. Requires icon-text-fit to be one of both, width, height. Supports interpolate expressions.

Size of the additional area added to dimensions determined by icon-text-fit, in clockwise order: top, right, bottom, left.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.21.0 4.2.0 3.4.0"},{"location":"layers/#icon-image","title":"icon-image","text":"

Layout property. Optional resolvedImage.

Name of image in sprite to use for drawing an image background.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.35.0 5.1.0 3.6.0"},{"location":"layers/#icon-rotate","title":"icon-rotate","text":"

Layout property. Optional number. Units in degrees. Defaults to 0. Requires icon-image. Supports interpolate expressions.

Rotates the icon clockwise.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.21.0 5.0.0 3.5.0"},{"location":"layers/#icon-padding","title":"icon-padding","text":"

Layout property. Optional padding. Units in pixels. Defaults to 2. Requires icon-image. Supports interpolate expressions.

Size of additional area round the icon bounding box used for detecting symbol collisions.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 2.2.0 \u274c (#2754) \u274c (#2754)"},{"location":"layers/#icon-keep-upright","title":"icon-keep-upright","text":"

Layout property. Optional boolean. Defaults to false. Requires icon-image. Requires icon-rotation-alignment to be map. Requires symbol-placement to be one of line, line-center.

If true, the icon may be flipped to prevent it from being rendered upside-down.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#icon-offset","title":"icon-offset","text":"

Layout property. Optional array. Defaults to 0,0. Requires icon-image. Supports interpolate expressions.

Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of icon-size to obtain the final offset in pixels. When combined with icon-rotate the offset will be as if the rotated direction was up.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.29.0 5.0.0 3.5.0"},{"location":"layers/#icon-anchor","title":"icon-anchor","text":"

Layout property. Optional enum. Possible values: center, left, right, top, bottom, top-left, top-right, bottom-left, bottom-right. Defaults to center. Requires icon-image.

Part of the icon placed closest to the anchor.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.40.0 5.2.0 3.7.0 data-driven styling 0.40.0 5.2.0 3.7.0"},{"location":"layers/#icon-pitch-alignment","title":"icon-pitch-alignment","text":"

Layout property. Optional enum. Possible values: map, viewport, auto. Defaults to auto. Requires icon-image.

Orientation of icon when map is pitched.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.39.0 5.2.0 3.7.0"},{"location":"layers/#text-pitch-alignment","title":"text-pitch-alignment","text":"

Layout property. Optional enum. Possible values: map, viewport, auto. Defaults to auto. Requires text-field.

Orientation of text when map is pitched.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.21.0 4.2.0 3.4.0 auto value 0.25.0 4.2.0 3.4.0"},{"location":"layers/#text-rotation-alignment","title":"text-rotation-alignment","text":"

Layout property. Optional enum. Possible values: map, viewport, viewport-glyph, auto. Defaults to auto. Requires text-field.

In combination with symbol-placement, determines the rotation behavior of the individual glyphs forming the text.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 auto value 0.25.0 4.2.0 3.4.0 viewport-glyph value 2.1.8 \u274c (#250) \u274c (#250)"},{"location":"layers/#text-field","title":"text-field","text":"

Layout property. Optional formatted. Defaults to ``.

Value to use for a text label. If a plain string is provided, it will be treated as a formatted with default/inherited formatting options.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#text-font","title":"text-font","text":"

Layout property. Optional array. Defaults to Open Sans Regular,Arial Unicode MS Regular. Requires text-field.

Font stack to use for displaying text.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.43.0 6.0.0 4.0.0"},{"location":"layers/#text-size","title":"text-size","text":"

Layout property. Optional number in range [0, \u221e). Units in pixels. Defaults to 16. Requires text-field. Supports interpolate expressions.

Font size.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.35.0 5.1.0 3.6.0"},{"location":"layers/#text-max-width","title":"text-max-width","text":"

Layout property. Optional number in range [0, \u221e). Units in ems. Defaults to 10. Requires text-field. Supports interpolate expressions.

The maximum line width for text wrapping.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.40.0 5.2.0 3.7.0"},{"location":"layers/#text-line-height","title":"text-line-height","text":"

Layout property. Optional number. Units in ems. Defaults to 1.2. Requires text-field. Supports interpolate expressions.

Text leading value for multi-line text.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#text-letter-spacing","title":"text-letter-spacing","text":"

Layout property. Optional number. Units in ems. Defaults to 0. Requires text-field. Supports interpolate expressions.

Text tracking amount.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.40.0 5.2.0 3.7.0"},{"location":"layers/#text-justify","title":"text-justify","text":"

Layout property. Optional enum. Possible values: auto, left, center, right. Defaults to center. Requires text-field.

Text justification options.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.39.0 5.2.0 3.7.0 auto 0.54.0 7.4.0 4.10.0"},{"location":"layers/#text-radial-offset","title":"text-radial-offset","text":"

Layout property. Optional number. Units in ems. Defaults to 0. Requires text-field. Supports interpolate expressions.

Radial offset of text, in the direction of the symbol's anchor. Useful in combination with text-variable-anchor, which defaults to using the two-dimensional text-offset if present.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.54.0 7.4.0 4.10.0 data-driven styling 0.54.0 7.4.0 4.10.0"},{"location":"layers/#text-variable-anchor","title":"text-variable-anchor","text":"

Layout property. Optional array. Requires text-field. Requires symbol-placement to be point.

To increase the chance of placing high-priority labels on the map, you can provide an array of text-anchor locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use text-justify: auto to choose justification based on anchor position. To apply an offset, use the text-radial-offset or the two-dimensional text-offset.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.54.0 7.4.0 4.10.0"},{"location":"layers/#text-variable-anchor-offset","title":"text-variable-anchor-offset","text":"

Layout property. Optional. Requires text-field. Requires symbol-placement to be point. Supports interpolate expressions.

To increase the chance of placing high-priority labels on the map, you can provide an array of text-anchor locations, each paired with an offset value. The renderer will attempt to place the label at each location, in order, before moving on to the next location+offset. Use text-justify: auto to choose justification based on anchor position.

The length of the array must be even, and must alternate between enum and point entries. i.e., each anchor location must be accompanied by a point, and that point defines the offset when the corresponding anchor location is used. Positive offset values indicate right and down, while negative values indicate left and up. Anchor locations may repeat, allowing the renderer to try multiple offsets to try and place a label using the same anchor.

When present, this property takes precedence over text-anchor, text-variable-anchor, text-offset, and text-radial-offset.

{ \"text-variable-anchor-offset\": [\"top\", [0, 4], \"left\", [3,0], \"bottom\", [1, 1]] } \n

When the renderer chooses the top anchor, [0, 4] will be used for text-offset; the text will be shifted down by 4 ems.

When the renderer chooses the left anchor, [3, 0] will be used for text-offset; the text will be shifted right by 3 ems.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 3.3.0 \u274c (#2358) \u274c (#2358) data-driven styling 3.3.0 \u274c (#2358) \u274c (#2358)"},{"location":"layers/#text-anchor","title":"text-anchor","text":"

Layout property. Optional enum. Possible values: center, left, right, top, bottom, top-left, top-right, bottom-left, bottom-right. Defaults to center. Requires text-field. Disabled by text-variable-anchor.

Part of the text placed closest to the anchor.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.39.0 5.2.0 3.7.0"},{"location":"layers/#text-max-angle","title":"text-max-angle","text":"

Layout property. Optional number. Units in degrees. Defaults to 45. Requires text-field. Requires symbol-placement to be one of line, line-center. Supports interpolate expressions.

Maximum angle change between adjacent characters.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#text-writing-mode","title":"text-writing-mode","text":"

Layout property. Optional array. Requires text-field. Requires symbol-placement to be point.

The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn\u2019t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 1.3.0 8.3.0 5.3.0"},{"location":"layers/#text-rotate","title":"text-rotate","text":"

Layout property. Optional number. Units in degrees. Defaults to 0. Requires text-field. Supports interpolate expressions.

Rotates the text clockwise.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.35.0 5.1.0 3.6.0"},{"location":"layers/#text-padding","title":"text-padding","text":"

Layout property. Optional number in range [0, \u221e). Units in pixels. Defaults to 2. Requires text-field. Supports interpolate expressions.

Size of the additional area around the text bounding box used for detecting symbol collisions.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#text-keep-upright","title":"text-keep-upright","text":"

Layout property. Optional boolean. Defaults to true. Requires text-field. Requires text-rotation-alignment to be map. Requires symbol-placement to be one of line, line-center.

If true, the text may be flipped vertically to prevent it from being rendered upside-down.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#text-transform","title":"text-transform","text":"

Layout property. Optional enum. Possible values: none, uppercase, lowercase. Defaults to none. Requires text-field.

Specifies how to capitalize text, similar to the CSS text-transform property.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#text-offset","title":"text-offset","text":"

Layout property. Optional array. Units in ems. Defaults to 0,0. Requires text-field. Disabled by text-radial-offset. Supports interpolate expressions.

Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.35.0 5.1.0 3.6.0"},{"location":"layers/#text-allow-overlap","title":"text-allow-overlap","text":"

Layout property. Optional boolean. Defaults to false. Requires text-field. Disabled by text-overlap.

If true, the text will be visible even if it collides with other previously drawn symbols.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#text-overlap","title":"text-overlap","text":"

Layout property. Optional enum. Possible values: never, always, cooperative. Requires text-field.

Allows for control over whether to show symbol text when it overlaps other symbols on the map. If text-overlap is not set, text-allow-overlap is used instead

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 2.1.0 \u274c (#251) \u274c (#251)"},{"location":"layers/#text-ignore-placement","title":"text-ignore-placement","text":"

Layout property. Optional boolean. Defaults to false. Requires text-field.

If true, other symbols can be visible even if they collide with the text.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#text-optional","title":"text-optional","text":"

Layout property. Optional boolean. Defaults to false. Requires text-field. Requires icon-image.

If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#visibility_6","title":"visibility","text":"

Layout property. Optional enum. Possible values: visible, none. Defaults to visible.

Whether this layer is displayed.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#icon-opacity","title":"icon-opacity","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Requires icon-image. Supports feature-state and interpolate expressions. Transitionable.

The opacity at which the icon will be drawn.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#icon-color","title":"icon-color","text":"

Paint property. Optional color. Defaults to #000000. Requires icon-image. Supports feature-state and interpolate expressions. Transitionable.

The color of the icon. This can only be used with SDF icons.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#icon-halo-color","title":"icon-halo-color","text":"

Paint property. Optional color. Defaults to rgba(0, 0, 0, 0). Requires icon-image. Supports feature-state and interpolate expressions. Transitionable.

The color of the icon's halo. Icon halos can only be used with SDF icons.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#icon-halo-width","title":"icon-halo-width","text":"

Paint property. Optional number in range [0, \u221e). Units in pixels. Defaults to 0. Requires icon-image. Supports feature-state and interpolate expressions. Transitionable.

Distance of halo to the icon outline.

The unit is in pixels only for SDF sprites that were created with a blur radius of 8, multiplied by the display density. I.e., the radius needs to be 16 for @2x sprites, etc.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#icon-halo-blur","title":"icon-halo-blur","text":"

Paint property. Optional number in range [0, \u221e). Units in pixels. Defaults to 0. Requires icon-image. Supports feature-state and interpolate expressions. Transitionable.

Fade out the halo towards the outside.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#icon-translate","title":"icon-translate","text":"

Paint property. Optional array. Units in pixels. Defaults to 0,0. Requires icon-image. Supports interpolate expressions. Transitionable.

Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#icon-translate-anchor","title":"icon-translate-anchor","text":"

Paint property. Optional enum. Possible values: map, viewport. Defaults to map. Requires icon-image. Requires icon-translate.

Controls the frame of reference for icon-translate.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#text-opacity","title":"text-opacity","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Requires text-field. Supports feature-state and interpolate expressions. Transitionable.

The opacity at which the text will be drawn.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#text-color","title":"text-color","text":"

Paint property. Optional color. Defaults to #000000. Requires text-field. Supports feature-state and interpolate expressions. Transitionable.

The color with which the text will be drawn.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#text-halo-color","title":"text-halo-color","text":"

Paint property. Optional color. Defaults to rgba(0, 0, 0, 0). Requires text-field. Supports feature-state and interpolate expressions. Transitionable.

The color of the text's halo, which helps it stand out from backgrounds.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#text-halo-width","title":"text-halo-width","text":"

Paint property. Optional number in range [0, \u221e). Units in pixels. Defaults to 0. Requires text-field. Supports feature-state and interpolate expressions. Transitionable.

Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#text-halo-blur","title":"text-halo-blur","text":"

Paint property. Optional number in range [0, \u221e). Units in pixels. Defaults to 0. Requires text-field. Supports feature-state and interpolate expressions. Transitionable.

The halo's fadeout distance towards the outside.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#text-translate","title":"text-translate","text":"

Paint property. Optional array. Units in pixels. Defaults to 0,0. Requires text-field. Supports interpolate expressions. Transitionable.

Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#text-translate-anchor","title":"text-translate-anchor","text":"

Paint property. Optional enum. Possible values: map, viewport. Defaults to map. Requires text-field. Requires text-translate.

Controls the frame of reference for text-translate.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#raster","title":"Raster","text":""},{"location":"layers/#visibility_7","title":"visibility","text":"

Layout property. Optional enum. Possible values: visible, none. Defaults to visible.

Whether this layer is displayed.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#raster-opacity","title":"raster-opacity","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Supports interpolate expressions. Transitionable.

The opacity at which the image will be drawn.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#raster-hue-rotate","title":"raster-hue-rotate","text":"

Paint property. Optional number. Units in degrees. Defaults to 0. Supports interpolate expressions. Transitionable.

Rotates hues around the color wheel.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#raster-brightness-min","title":"raster-brightness-min","text":"

Paint property. Optional number in range [0, 1]. Defaults to 0. Supports interpolate expressions. Transitionable.

Increase or reduce the brightness of the image. The value is the minimum brightness.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#raster-brightness-max","title":"raster-brightness-max","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Supports interpolate expressions. Transitionable.

Increase or reduce the brightness of the image. The value is the maximum brightness.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#raster-saturation","title":"raster-saturation","text":"

Paint property. Optional number in range [-1, 1]. Defaults to 0. Supports interpolate expressions. Transitionable.

Increase or reduce the saturation of the image.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#raster-contrast","title":"raster-contrast","text":"

Paint property. Optional number in range [-1, 1]. Defaults to 0. Supports interpolate expressions. Transitionable.

Increase or reduce the contrast of the image.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#raster-resampling","title":"raster-resampling","text":"

Paint property. Optional enum. Possible values: linear, nearest. Defaults to linear.

The resampling/interpolation method to use for overscaling, also known as texture magnification filter

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.47.0 6.3.0 4.2.0"},{"location":"layers/#raster-fade-duration","title":"raster-fade-duration","text":"

Paint property. Optional number in range [0, \u221e). Units in milliseconds. Defaults to 300. Supports interpolate expressions.

Fade duration when a new tile is added, or when a video is started or its coordinates are updated.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#hillshade","title":"Hillshade","text":""},{"location":"layers/#visibility_8","title":"visibility","text":"

Layout property. Optional enum. Possible values: visible, none. Defaults to visible.

Whether this layer is displayed.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.43.0 6.0.0 4.0.0"},{"location":"layers/#hillshade-illumination-direction","title":"hillshade-illumination-direction","text":"

Paint property. Optional number in range [0, 359]. Defaults to 335. Supports interpolate expressions.

The direction of the light source used to generate the hillshading with 0 as the top of the viewport if hillshade-illumination-anchor is set to viewport and due north if hillshade-illumination-anchor is set to map.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.43.0 6.0.0 4.0.0"},{"location":"layers/#hillshade-illumination-anchor","title":"hillshade-illumination-anchor","text":"

Paint property. Optional enum. Possible values: map, viewport. Defaults to viewport.

Direction of light source when map is rotated.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.43.0 6.0.0 4.0.0"},{"location":"layers/#hillshade-exaggeration","title":"hillshade-exaggeration","text":"

Paint property. Optional number in range [0, 1]. Defaults to 0.5. Supports interpolate expressions. Transitionable.

Intensity of the hillshade

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.43.0 6.0.0 4.0.0"},{"location":"layers/#hillshade-shadow-color","title":"hillshade-shadow-color","text":"

Paint property. Optional color. Defaults to #000000. Supports interpolate expressions. Transitionable.

The shading color of areas that face away from the light source.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.43.0 6.0.0 4.0.0"},{"location":"layers/#hillshade-highlight-color","title":"hillshade-highlight-color","text":"

Paint property. Optional color. Defaults to #FFFFFF. Supports interpolate expressions. Transitionable.

The shading color of areas that faces towards the light source.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.43.0 6.0.0 4.0.0"},{"location":"layers/#hillshade-accent-color","title":"hillshade-accent-color","text":"

Paint property. Optional color. Defaults to #000000. Supports interpolate expressions. Transitionable.

The shading color used to accentuate rugged terrain like sharp cliffs and gorges.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.43.0 6.0.0 4.0.0"},{"location":"light/","title":"Light","text":"

The global light source.

light: {\"anchor\": \"viewport\", \"color\": \"white\", \"intensity\": 0.4}\n
"},{"location":"light/#anchor","title":"anchor","text":"

Optional enum. Possible values: map, viewport. Defaults to viewport.

Whether extruded geometries are lit relative to the map or viewport.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0"},{"location":"light/#position","title":"position","text":"

Optional array. Defaults to 1.15,210,30. Supports interpolate expressions. Transitionable.

Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0\u00b0 (0\u00b0 when light.anchor is set to viewport corresponds to the top of the viewport, or 0\u00b0 when light.anchor is set to map corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0\u00b0, directly above, to 180\u00b0, directly below).

position: [1.5, 90, 80]\n
SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0"},{"location":"light/#color","title":"color","text":"

Optional color. Defaults to #ffffff. Supports interpolate expressions. Transitionable.

Color tint for lighting extruded geometries.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0"},{"location":"light/#intensity","title":"intensity","text":"

Optional number in range [0, 1]. Defaults to 0.5. Supports interpolate expressions. Transitionable.

Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0"},{"location":"projection/","title":"Projection","text":"

The projection configuration. Note: this definition is still experimental and is under development in maplibre-gl-js.

projection: {\"type\": \"globe\"}\n
"},{"location":"projection/#type","title":"type","text":"

Optional enum. Possible values: mercator, globe. Defaults to mercator.

The projection type.

"},{"location":"root/","title":"Root","text":"

Root level properties of a MapLibre style specify the map's layers, tile sources and other resources, and default values for the initial camera position when not specified elsewhere.

{\n    \"version\": 8,\n    \"name\": \"MapLibre Demo Tiles\",\n    \"sprite\": \"https://demotiles.maplibre.org/styles/osm-bright-gl-style/sprite\",\n    \"glyphs\": \"https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf\",\n    \"sources\": {... },\n    \"layers\": [...]\n}\n
"},{"location":"root/#version","title":"version","text":"

Required enum.

Style specification version number. Must be 8.

version: 8\n
"},{"location":"root/#name","title":"name","text":"

Optional string.

A human-readable name for the style.

name: \"Bright\"\n
"},{"location":"root/#metadata","title":"metadata","text":"

Optional.

Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'maplibre:'.

metadata: {\n    \"styleeditor:slimmode\": true,\n    \"styleeditor:comment\": \"Style generated 1677776383\",\n    \"styleeditor:version\": \"3.14.159265\",\n    \"example:object\": {\n        \"String\": \"one\",\n        \"Number\": 2,\n        \"Boolean\": false\n    }\n}\n
"},{"location":"root/#center","title":"center","text":"

Optional array.

Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).

center: [-73.9749, 40.7736]\n
"},{"location":"root/#zoom","title":"zoom","text":"

Optional number.

Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).

zoom: 12.5\n
"},{"location":"root/#bearing","title":"bearing","text":"

Optional number. Units in degrees. Defaults to 0.

Default bearing, in degrees. The bearing is the compass direction that is \"up\"; for example, a bearing of 90\u00b0 orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).

bearing: 29\n
"},{"location":"root/#pitch","title":"pitch","text":"

Optional number. Units in degrees. Defaults to 0.

Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).

pitch: 50\n
"},{"location":"root/#light","title":"light","text":"

Optional light.

The global light source.

light: {\"anchor\": \"viewport\", \"color\": \"white\", \"intensity\": 0.4}\n
"},{"location":"root/#sky","title":"sky","text":"

Optional sky.

The map's sky configuration. Note: this definition is still experimental and is under development in maplibre-gl-js.

sky: {\n    \"sky-color\": \"#199EF3\",\n    \"sky-horizon-blend\": 0.5,\n    \"horizon-color\": \"#ffffff\",\n    \"horizon-fog-blend\": 0.5,\n    \"fog-color\": \"#0000ff\",\n    \"fog-ground-blend\": 0.5,\n    \"atmosphere-blend\": [\n        \"interpolate\",\n        [\"linear\"],\n        [\"zoom\"],\n        0,\n        1,\n        10,\n        1,\n        12,\n        0\n    ]\n}\n
"},{"location":"root/#projection","title":"projection","text":"

Optional projection.

The projection configuration. Note: this definition is still experimental and is under development in maplibre-gl-js.

projection: {\"type\": \"globe\"}\n
"},{"location":"root/#terrain","title":"terrain","text":"

Optional terrain.

The terrain configuration.

terrain: {\"source\": \"raster-dem-source\", \"exaggeration\": 0.5}\n
"},{"location":"root/#sources","title":"sources","text":"

Required sources.

Sources state which data the map should display. Specify the type of source with the type property. Adding a source isn't enough to make data appear on the map because sources don't contain styling details like color or width. Layers refer to a source and give it a visual representation. This makes it possible to style the same source in different ways, like differentiating between types of roads in a highways layer.

Tiled sources (vector and raster) must specify their details according to the TileJSON specification.

sources: {\n    \"maplibre-demotiles\": {\n        \"type\": \"vector\",\n        \"url\": \"https://demotiles.maplibre.org/tiles/tiles.json\"\n    },\n    \"maplibre-tilejson\": {\n        \"type\": \"vector\",\n        \"url\": \"http://api.example.com/tilejson.json\"\n    },\n    \"maplibre-streets\": {\n        \"type\": \"vector\",\n        \"tiles\": [\n            \"http://a.example.com/tiles/{z}/{x}/{y}.pbf\",\n            \"http://b.example.com/tiles/{z}/{x}/{y}.pbf\"\n        ],\n        \"maxzoom\": 14\n    },\n    \"wms-imagery\": {\n        \"type\": \"raster\",\n        \"tiles\": [\n            \"http://a.example.com/wms?bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:3857&width=256&height=256&layers=example\"\n        ],\n        \"tileSize\": 256\n    }\n}\n
"},{"location":"root/#sprite","title":"sprite","text":"

Optional sprite.

An array of {id: 'my-sprite', url: 'https://example.com/sprite'} objects. Each object should represent a unique URL to load a sprite from and and a unique ID to use as a prefix when referencing images from that sprite (i.e. 'my-sprite:image'). All the URLs are internally extended to load both .json and .png files. If the id field is equal to 'default', the prefix is omitted (just 'image' instead of 'default:image'). All the IDs and URLs must be unique. For backwards compatibility, instead of an array, one can also provide a single string that represent a URL to load the sprite from. The images in this case won't be prefixed.

sprite: \"https://demotiles.maplibre.org/styles/osm-bright-gl-style/sprite\"\n
"},{"location":"root/#glyphs","title":"glyphs","text":"

Optional string.

A URL template for loading signed-distance-field glyph sets in PBF format.

The URL must include:

This property is required if any layer uses the text-field layout property. The URL must be absolute, containing the scheme, authority and path components.

glyphs: \"https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf\"\n
"},{"location":"root/#transition","title":"transition","text":"

Optional transition.

A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's transition property.

transition: {\"duration\": 300, \"delay\": 0}\n
"},{"location":"root/#layers","title":"layers","text":"

Required array.

A style's layers property lists all the layers available in that style. The type of layer is specified by the type property, and must be one of background, fill, line, symbol, raster, circle, fill-extrusion, heatmap, hillshade.

Except for layers of the background type, each layer needs to refer to a source. Layers take the data that they get from a source, optionally filter features, and then define how those features are styled.

layers: [\n    {\n        \"id\": \"coastline\",\n        \"source\": \"maplibre\",\n        \"source-layer\": \"contries\",\n        \"type\": \"line\",\n        \"paint\": {\"line-color\": \"#198EC8\"}\n    }\n]\n
"},{"location":"sky/","title":"Sky","text":"

The map's sky configuration. Note: this definition is still experimental and is under development in maplibre-gl-js.

sky: {\n    \"sky-color\": \"#199EF3\",\n    \"sky-horizon-blend\": 0.5,\n    \"horizon-color\": \"#ffffff\",\n    \"horizon-fog-blend\": 0.5,\n    \"fog-color\": \"#0000ff\",\n    \"fog-ground-blend\": 0.5,\n    \"atmosphere-blend\": [\n        \"interpolate\",\n        [\"linear\"],\n        [\"zoom\"],\n        0,\n        1,\n        10,\n        1,\n        12,\n        0\n    ]\n}\n
"},{"location":"sky/#sky-color","title":"sky-color","text":"

Optional color. Defaults to #88C6FC. Supports interpolate expressions. Transitionable.

The base color for the sky.

"},{"location":"sky/#horizon-color","title":"horizon-color","text":"

Optional color. Defaults to #ffffff. Supports interpolate expressions. Transitionable.

The base color at the horizon.

"},{"location":"sky/#fog-color","title":"fog-color","text":"

Optional color. Defaults to #ffffff. Supports interpolate expressions. Transitionable.

The base color for the fog. Requires 3D terrain.

"},{"location":"sky/#fog-ground-blend","title":"fog-ground-blend","text":"

Optional number in range [0, 1]. Defaults to 0.5. Supports interpolate expressions. Transitionable.

How to blend the fog over the 3D terrain. Where 0 is the map center and 1 is the horizon.

"},{"location":"sky/#horizon-fog-blend","title":"horizon-fog-blend","text":"

Optional number in range [0, 1]. Defaults to 0.8. Supports interpolate expressions. Transitionable.

How to blend the fog color and the horizon color. Where 0 is using the horizon color only and 1 is using the fog color only.

"},{"location":"sky/#sky-horizon-blend","title":"sky-horizon-blend","text":"

Optional number in range [0, 1]. Defaults to 0.8. Supports interpolate expressions. Transitionable.

How to blend the the sky color and the horizon color. Where 1 is blending the color at the middle of the sky and 0 is not blending at all and using the sky color only.

"},{"location":"sky/#atmosphere-blend","title":"atmosphere-blend","text":"

Optional number in range [0, 1]. Defaults to 0.8. Supports interpolate expressions. Transitionable.

How to blend the atmosphere. Where 1 is visible atmosphere and 0 is hidden. It is best to interpolate this expression when using globe projection.

"},{"location":"sources/","title":"Sources","text":"

Sources state which data the map should display. Specify the type of source with the type property. Adding a source isn't enough to make data appear on the map because sources don't contain styling details like color or width. Layers refer to a source and give it a visual representation. This makes it possible to style the same source in different ways, like differentiating between types of roads in a highways layer.

Tiled sources (vector and raster) must specify their details according to the TileJSON specification.

sources: {\n    \"maplibre-demotiles\": {\n        \"type\": \"vector\",\n        \"url\": \"https://demotiles.maplibre.org/tiles/tiles.json\"\n    },\n    \"maplibre-tilejson\": {\n        \"type\": \"vector\",\n        \"url\": \"http://api.example.com/tilejson.json\"\n    },\n    \"maplibre-streets\": {\n        \"type\": \"vector\",\n        \"tiles\": [\n            \"http://a.example.com/tiles/{z}/{x}/{y}.pbf\",\n            \"http://b.example.com/tiles/{z}/{x}/{y}.pbf\"\n        ],\n        \"maxzoom\": 14\n    },\n    \"wms-imagery\": {\n        \"type\": \"raster\",\n        \"tiles\": [\n            \"http://a.example.com/wms?bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:3857&width=256&height=256&layers=example\"\n        ],\n        \"tileSize\": 256\n    }\n}\n
"},{"location":"sources/#vector","title":"vector","text":"

A vector tile source. Tiles must be in Mapbox Vector Tile format. All geometric coordinates in vector tiles must be between -1 * extent and (extent * 2) - 1 inclusive. All layers that use a vector source must specify a source-layer value.

sources: {\n    \"maplibre-streets\": {\n        \"type\": \"vector\",\n        \"tiles\": [\n            \"http://a.example.com/tiles/{z}/{x}/{y}.pbf\"\n        ]\n    }\n}\n
SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"sources/#type","title":"type","text":"

Required enum. Possible values: vector.

The type of the source.

"},{"location":"sources/#url","title":"url","text":"

Optional string.

A URL to a TileJSON resource. Supported protocols are http: and https:.

"},{"location":"sources/#tiles","title":"tiles","text":"

Optional array.

An array of one or more tile source URLs, as in the TileJSON spec.

"},{"location":"sources/#bounds","title":"bounds","text":"

Optional array. Defaults to -180,-85.051129,180,85.051129.

An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: [sw.lng, sw.lat, ne.lng, ne.lat]. When this property is included in a source, no tiles outside of the given bounds are requested by MapLibre.

"},{"location":"sources/#scheme","title":"scheme","text":"

Optional enum. Possible values: xyz, tms. Defaults to xyz.

Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed.

"},{"location":"sources/#minzoom","title":"minzoom","text":"

Optional number. Defaults to 0.

Minimum zoom level for which tiles are available, as in the TileJSON spec.

"},{"location":"sources/#maxzoom","title":"maxzoom","text":"

Optional number. Defaults to 22.

Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels.

"},{"location":"sources/#attribution","title":"attribution","text":"

Optional string.

Contains an attribution to be displayed when the map is shown to a user.

"},{"location":"sources/#promoteid","title":"promoteId","text":"

Optional promoteId.

A property to use as a feature id (for feature state). Either a property name, or an object of the form {<sourceLayer>: <propertyName>}. If specified as a string for a vector tile source, the same property is used across all its source layers.

"},{"location":"sources/#volatile","title":"volatile","text":"

Optional boolean. Defaults to false.

A setting to determine whether a source's tiles are cached locally.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality Not planned 9.3.0 5.10.0"},{"location":"sources/#raster","title":"raster","text":"

A raster tile source.

sources: {\n    \"maplibre-satellite\": {\n        \"type\": \"raster\",\n        \"tiles\": [\n            \"http://a.example.com/tiles/{z}/{x}/{y}.png\"\n        ],\n        \"tileSize\": 256\n    }\n}\n
SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"sources/#type_1","title":"type","text":"

Required enum. Possible values: raster.

The type of the source.

"},{"location":"sources/#url_1","title":"url","text":"

Optional string.

A URL to a TileJSON resource. Supported protocols are http: and https:.

"},{"location":"sources/#tiles_1","title":"tiles","text":"

Optional array.

An array of one or more tile source URLs, as in the TileJSON spec.

"},{"location":"sources/#bounds_1","title":"bounds","text":"

Optional array. Defaults to -180,-85.051129,180,85.051129.

An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: [sw.lng, sw.lat, ne.lng, ne.lat]. When this property is included in a source, no tiles outside of the given bounds are requested by MapLibre.

"},{"location":"sources/#minzoom_1","title":"minzoom","text":"

Optional number. Defaults to 0.

Minimum zoom level for which tiles are available, as in the TileJSON spec.

"},{"location":"sources/#maxzoom_1","title":"maxzoom","text":"

Optional number. Defaults to 22.

Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels.

"},{"location":"sources/#tilesize","title":"tileSize","text":"

Optional number. Units in pixels. Defaults to 512.

The minimum visual size to display tiles for this layer. Only configurable for raster layers.

"},{"location":"sources/#scheme_1","title":"scheme","text":"

Optional enum. Possible values: xyz, tms. Defaults to xyz.

Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed.

"},{"location":"sources/#attribution_1","title":"attribution","text":"

Optional string.

Contains an attribution to be displayed when the map is shown to a user.

"},{"location":"sources/#volatile_1","title":"volatile","text":"

Optional boolean. Defaults to false.

A setting to determine whether a source's tiles are cached locally.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality Not planned 9.3.0 5.10.0"},{"location":"sources/#raster-dem","title":"raster-dem","text":"

A raster DEM source. Only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.

sources: {\n    \"maplibre-terrain-rgb\": {\n        \"type\": \"raster-dem\",\n        \"encoding\": \"mapbox\",\n        \"tiles\": [\n            \"http://a.example.com/dem-tiles/{z}/{x}/{y}.png\"\n        ]\n    }\n}\n
SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.43.0 6.0.0 4.0.0"},{"location":"sources/#type_2","title":"type","text":"

Required enum. Possible values: raster-dem.

The type of the source.

"},{"location":"sources/#url_2","title":"url","text":"

Optional string.

A URL to a TileJSON resource. Supported protocols are http: and https:.

"},{"location":"sources/#tiles_2","title":"tiles","text":"

Optional array.

An array of one or more tile source URLs, as in the TileJSON spec.

"},{"location":"sources/#bounds_2","title":"bounds","text":"

Optional array. Defaults to -180,-85.051129,180,85.051129.

An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: [sw.lng, sw.lat, ne.lng, ne.lat]. When this property is included in a source, no tiles outside of the given bounds are requested by MapLibre.

"},{"location":"sources/#minzoom_2","title":"minzoom","text":"

Optional number. Defaults to 0.

Minimum zoom level for which tiles are available, as in the TileJSON spec.

"},{"location":"sources/#maxzoom_2","title":"maxzoom","text":"

Optional number. Defaults to 22.

Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels.

"},{"location":"sources/#tilesize_1","title":"tileSize","text":"

Optional number. Units in pixels. Defaults to 512.

The minimum visual size to display tiles for this layer. Only configurable for raster layers.

"},{"location":"sources/#attribution_2","title":"attribution","text":"

Optional string.

Contains an attribution to be displayed when the map is shown to a user.

"},{"location":"sources/#encoding","title":"encoding","text":"

Optional enum. Possible values: terrarium, mapbox, custom. Defaults to mapbox.

The encoding used by this source. Mapbox Terrain RGB is used by default.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS mapbox, terrarium 0.43.0 6.0.0 6.0.0 custom 3.4.0 \u274c (#2783) \u274c (#2783)"},{"location":"sources/#redfactor","title":"redFactor","text":"

Optional number. Defaults to 1.

Value that will be multiplied by the red channel value when decoding. Only used on custom encodings.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 3.4.0 \u274c (#2783) \u274c (#2783)"},{"location":"sources/#bluefactor","title":"blueFactor","text":"

Optional number. Defaults to 1.

Value that will be multiplied by the blue channel value when decoding. Only used on custom encodings.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 3.4.0 \u274c (#2783) \u274c (#2783)"},{"location":"sources/#greenfactor","title":"greenFactor","text":"

Optional number. Defaults to 1.

Value that will be multiplied by the green channel value when decoding. Only used on custom encodings.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 3.4.0 \u274c (#2783) \u274c (#2358)"},{"location":"sources/#baseshift","title":"baseShift","text":"

Optional number. Defaults to 0.

Value that will be added to the encoding mix when decoding. Only used on custom encodings.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 3.4.0 \u274c (#2783) \u274c (#2783)"},{"location":"sources/#volatile_2","title":"volatile","text":"

Optional boolean. Defaults to false.

A setting to determine whether a source's tiles are cached locally.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality Not planned 9.3.0 5.10.0"},{"location":"sources/#geojson","title":"geojson","text":"

A GeoJSON source. Data must be provided via a \"data\" property, whose value can be a URL or inline GeoJSON. When using in a browser, the GeoJSON data must be on the same domain as the map or served with CORS headers.

sources: {\n    \"geojson-marker\": {\n        \"type\": \"geojson\",\n        \"data\": {\n            \"type\": \"Feature\",\n            \"geometry\": {\n                \"type\": \"Point\",\n                \"coordinates\": [12.550343, 55.665957]\n            },\n            \"properties\": {\n                \"title\": \"Somewhere\",\n                \"marker-symbol\": \"monument\"\n            }\n        }\n    },\n    \"geojson-lines\": {\n        \"type\": \"geojson\",\n        \"data\": \"./lines.geojson\"\n    }\n}\n
SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 clustering 0.14.0 4.2.0 3.4.0 line distance metrics 0.45.0 6.5.0 4.4.0"},{"location":"sources/#type_3","title":"type","text":"

Required enum. Possible values: geojson.

The data type of the GeoJSON source.

"},{"location":"sources/#data","title":"data","text":"

Required.

A URL to a GeoJSON file, or inline GeoJSON.

"},{"location":"sources/#maxzoom_3","title":"maxzoom","text":"

Optional number. Defaults to 18.

Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels).

"},{"location":"sources/#attribution_3","title":"attribution","text":"

Optional string.

Contains an attribution to be displayed when the map is shown to a user.

"},{"location":"sources/#buffer","title":"buffer","text":"

Optional number in range [0, 512]. Defaults to 128.

Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance.

"},{"location":"sources/#filter","title":"filter","text":"

Optional.

An expression for filtering features prior to processing them for rendering.

"},{"location":"sources/#tolerance","title":"tolerance","text":"

Optional number. Defaults to 0.375.

Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance).

"},{"location":"sources/#cluster","title":"cluster","text":"

Optional boolean. Defaults to false.

If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new Point features in the source with additional properties:

"},{"location":"sources/#clusterradius","title":"clusterRadius","text":"

Optional number in range [0, \u221e). Defaults to 50.

Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile.

"},{"location":"sources/#clustermaxzoom","title":"clusterMaxZoom","text":"

Optional number.

Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15.

"},{"location":"sources/#clusterminpoints","title":"clusterMinPoints","text":"

Optional number.

Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to 2.

"},{"location":"sources/#clusterproperties","title":"clusterProperties","text":"

Optional.

An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form {\"property_name\": [operator, map_expression]}. operator is any expression function that accepts at least 2 operands (e.g. \"+\" or \"max\") \u2014 it accumulates the property value from clusters/points the cluster contains; map_expression produces the value of a single point.

Example: {\"sum\": [\"+\", [\"get\", \"scalerank\"]]}.

For more advanced use cases, in place of operator, you can use a custom reduce expression that references a special [\"accumulated\"] value, e.g.:

{\"sum\": [[\"+\", [\"accumulated\"], [\"get\", \"sum\"]], [\"get\", \"scalerank\"]]}

"},{"location":"sources/#linemetrics","title":"lineMetrics","text":"

Optional boolean. Defaults to false.

Whether to calculate line distance metrics. This is required for line layers that specify line-gradient values.

"},{"location":"sources/#generateid","title":"generateId","text":"

Optional boolean. Defaults to false.

Whether to generate ids for the geojson features. When enabled, the feature.id property will be auto assigned based on its index in the features array, over-writing any previous values.

"},{"location":"sources/#promoteid_1","title":"promoteId","text":"

Optional promoteId.

A property to use as a feature id (for feature state). Either a property name, or an object of the form {<sourceLayer>: <propertyName>}.

"},{"location":"sources/#video","title":"video","text":"

A video source. The urls value is an array. For each URL in the array, a video element source will be created. To support the video across browsers, supply URLs in multiple formats.

The coordinates array contains [longitude, latitude] pairs for the video corners listed in clockwise order: top left, top right, bottom right, bottom left.

When rendered as a raster layer, the layer's raster-fade-duration property will cause the video to fade in. This happens when playback is started, paused and resumed, or when the video's coordinates are updated. To avoid this behavior, set the layer's raster-fade-duration property to 0.

sources: {\n    \"video\": {\n        \"type\": \"video\",\n        \"urls\": [\n            \"https://static-assets.mapbox.com/mapbox-gl-js/drone.mp4\",\n            \"https://static-assets.mapbox.com/mapbox-gl-js/drone.webm\"\n        ],\n        \"coordinates\": [\n            [-122.51596391201019, 37.56238816766053],\n            [-122.51467645168304, 37.56410183312965],\n            [-122.51309394836426, 37.563391708549425],\n            [-122.51423120498657, 37.56161849366671]\n        ]\n    }\n}\n
SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 Not supported yet Not supported yet"},{"location":"sources/#type_4","title":"type","text":"

Required enum. Possible values: video.

The data type of the video source.

"},{"location":"sources/#urls","title":"urls","text":"

Required array.

URLs to video content in order of preferred format.

"},{"location":"sources/#coordinates","title":"coordinates","text":"

Required array.

Corners of video specified in longitude, latitude pairs.

"},{"location":"sources/#image","title":"image","text":"

An image source. The url value contains the image location. The coordinates array contains [longitude, latitude] pairs for the image corners listed in clockwise order: top left, top right, bottom right, bottom left.

sources: {\n    \"image\": {\n        \"type\": \"image\",\n        \"url\": \"https://maplibre.org/maplibre-gl-js/docs/assets/radar.gif\",\n        \"coordinates\": [\n            [-80.425, 46.437],\n            [-71.516, 46.437],\n            [-71.516, 37.936],\n            [-80.425, 37.936]\n        ]\n    }\n}\n
SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 5.2.0 3.7.0"},{"location":"sources/#type_5","title":"type","text":"

Required enum. Possible values: image.

The data type of the image source.

"},{"location":"sources/#url_3","title":"url","text":"

Required string.

URL that points to an image.

"},{"location":"sources/#coordinates_1","title":"coordinates","text":"

Required array.

Corners of image specified in longitude, latitude pairs.

"},{"location":"sprite/","title":"Sprite","text":"

Loading a sprite can be done using the optional sprite property at the root level of a MapLibre style sheet.

The images contained in the sprite can be referenced in other style properties (background-pattern, fill-pattern, line-pattern,fill-extrusion-pattern and icon-image).

"},{"location":"sprite/#usage","title":"Usage","text":"

You need to pass an URL where the sprite can be loaded from.

\"sprite\": \"https://demotiles.maplibre.org/styles/osm-bright-gl-style/sprite\"\n

This will load both an image by appending .png and the metadata about the sprite needed for loading by appending .json. See for yourself:

More details about the exact requirements on the format of these files is provided in the next section.

When a sprite is provided, you can refer to the images in the sprite in other parts of the style sheet. For example, when creating a symbol layer with the layout property \"icon-image\": \"poi\". Or with the tokenized value \"icon-image\": \"{icon}\" and vector tile features with an icon property with the value poi.

"},{"location":"sprite/#multiple-sprite-sources","title":"Multiple Sprite Sources","text":"

You can also supply an array of { id: ..., url: ... } pairs to load multiple sprites:

\"sprite\": [\n  {\n    id: 'roadsigns',\n    url: 'https://example.com/myroadsigns'\n  },\n  {\n    id: 'shops',\n    url: 'https://example2.com/someurl'\n  },\n  {\n    id: 'default',\n    url: 'https://example2.com/anotherurl'\n  }\n]\n

As you can see, each sprite has an id. All images contained within a sprite also have an id. When using multiple sprites, you need to prefix the id of the image with the id of the sprite it is contained within, followed by a colon. For example, to reference the stop_sign image on the roadsigns sprite, you would need to use roadsigns:stop_sign.

The sprite with id default is special in that you do not need to prefix the images contained within it. For example, to reference the image with id airport in the default sprite above, you can simply use airport.

"},{"location":"sprite/#sprite-source-format","title":"Sprite Source Format","text":"

A valid sprite source must supply two types of files:

{\n    \"poi\": {\n        \"width\": 32,\n        \"height\": 32,\n        \"x\": 0,\n        \"y\": 0,\n        \"pixelRatio\": 1\n    }\n}\n
SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality \u2705 \u2705 \u2705 textFitWidth, textFitHeight 4.2.0 11.4.0 6.6.0"},{"location":"sprite/#optional-properties","title":"Optional Properties","text":"

Apart from these required properties, the following optional properties are supported:

"},{"location":"sprite/#stretch-properties","title":"Stretch Properties","text":"

The following image gives a bit more infomation regarding the stretch properties:

{\n    \"shield\": {\n        \"width\": 25,\n        \"height\": 30,\n        \"x\": 0,\n        \"y\": 0,\n        \"stretchX\": [[5, 10], [15, 20]]\n        \"stretchY\": [[5, 20]]\n        \"pixelRatio\": 1\n    }\n}\n
The red highlighted part is where the stretch will occur over the Y axis and the blue highlight is for the X axis.

"},{"location":"sprite/#text-fit-properties","title":"Text Fit Properties","text":"

The properties textFitWidth and textFitHeight alter how a sprite's content rectangle maps to its contents when scaling a sprite. These properties are defined with the enum TextFit which may have the following values: * stretchOrShrink (or omitted) * stretchOnly * proportional

The primary use cases of interest are: 1. Both properties are undefined or stretchOrShrink

The content rectangle scales precisely to contain its contents.

  1. textFitWidth = stretchOnly and textFitHeight = proportional

The content rectangle scales to precisely contain the height of its contents but the width will not shrink smaller than the aspect ratio of the original content rectangle. This is primarily useful for shields that shouldn't become too narrow if their contents are narrow (like the number \"1\").

  1. textFitWidth = proportional and textFitHeight = stretchOnly

The content rectangle scales to precisely contain the width of its contents but the height will not shrink smaller than the aspect ratio of the original content rectangle. This may be useful scenarios like no. 2 except with vertically written scripts (using \"text-writing-mode\": [\"vertical\"]).

"},{"location":"sprite/#high-dpi-devices","title":"High-DPI Devices","text":"

On high-DPI devices, @2x is appended to the URLs described above. For example, if you specified \"sprite\": \"https://example.com/sprite\", renderers would load https://example.com/sprite.json and https://example.com/sprite.png, or https://example.com/sprite@2x.json and https://example.com/sprite@2x.png.

"},{"location":"sprite/#generating-sprites","title":"Generating Sprites","text":"

There are tools that can generate sprites from SVG files, such as spreet and spritezero.

"},{"location":"terrain/","title":"Terrain","text":"

The terrain configuration.

terrain: {\"source\": \"raster-dem-source\", \"exaggeration\": 0.5}\n
"},{"location":"terrain/#source","title":"source","text":"

Required string.

The source for the terrain data.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 2.2.0 \u274c (#252) \u274c (#252)"},{"location":"terrain/#exaggeration","title":"exaggeration","text":"

Optional number in range [0, \u221e). Defaults to 1.

The exaggeration of the terrain - how high it will look.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 2.2.0 \u274c (#252) \u274c (#252)"},{"location":"transition/","title":"Transition","text":"

A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's transition property.

transition: {\"duration\": 300, \"delay\": 0}\n
"},{"location":"transition/#duration","title":"duration","text":"

Optional number in range [0, \u221e). Units in milliseconds. Defaults to 300.

Time allotted for transitions to complete.

"},{"location":"transition/#delay","title":"delay","text":"

Optional number in range [0, \u221e). Units in milliseconds. Defaults to 0.

Length of time before a transition begins.

"},{"location":"types/","title":"Types","text":"

MapLibre style contains values of various types, most commonly as values for the style properties of a layer.

"},{"location":"types/#color","title":"Color","text":"

The color type is a color in the sRGB color space. Colors are JSON strings in a variety of permitted formats: HTML-style hex values, RGB, RGBA, HSL, and HSLA. Predefined HTML colors names, like yellow and blue, are also permitted.

{\n    \"line-color\": \"#ff0\",\n    \"line-color\": \"#ffff00\",\n    \"line-color\": \"rgb(255, 255, 0)\",\n    \"line-color\": \"rgba(255, 255, 0, 1)\",\n    \"line-color\": \"hsl(100, 50%, 50%)\",\n    \"line-color\": \"hsla(100, 50%, 50%, 1)\",\n    \"line-color\": \"yellow\"\n}\n
"},{"location":"types/#formatted","title":"Formatted","text":"

The formatted type is a string broken into sections annotated with separate formatting options.

{\n    \"text-field\": [\"format\",\n        \"foo\", { \"font-scale\": 1.2 },\n        \"bar\", { \"font-scale\": 0.8 }\n    ]\n}\n
"},{"location":"types/#resolvedimage","title":"ResolvedImage","text":"

The resolvedImage type is an image (e.g., an icon or pattern) which is used in a layer. An input to the image expression operator is checked against the current map style to see if it is available to be rendered or not, and the result is returned in the resolvedImage type. This approach allows developers to define a series of images which the map can fall back to if previous images are not found, which cannot be achieved by providing, for example, icon-image with a plain string (because multiple strings cannot be supplied to icon-image and multiple images cannot be defined in a string).

{\n    \"icon-image\": [\"coalesce\", [\"image\", \"myImage\"], [\"image\", \"fallbackImage\"]]\n}\n
"},{"location":"types/#string","title":"String","text":"

A string is text. In MapLibre styles, strings are in quotes.

{\n    \"source\": \"mySource\"\n}\n
"},{"location":"types/#boolean","title":"Boolean","text":"

Boolean means yes or no, so it accepts the values true or false.

{\n    \"fill-enabled\": true\n}\n
"},{"location":"types/#number","title":"Number","text":"

A number value, often an integer or floating point (decimal number). Written without quotes.

{\n    \"text-size\": 24\n}\n
"},{"location":"types/#array","title":"Array","text":"

Arrays are comma-separated lists of one or more values in a specific order. For example, they're used in line dash arrays, in which the numbers specify intervals of line, break, and line again. If an array is used as an argument in an expression, the array must be wrapped in a literal expression.

{\n    \"line-dasharray\": [2, 4]\n}\n\n{\n    \"circle-color\": [\"in\", 1, [\"literal\", [1, 2, 3]]]\n}\n
"},{"location":"types/#point","title":"Point","text":"

Points are two-element numeric arrays representing [x, y] coordinate pairs. Units and other interpretations of the x/y values depend on where and how the point type is used.

{\n    \"line-translate\": [2, 4]\n}\n
"},{"location":"types/#enum","title":"Enum","text":"

Enums are a closed set of possible string values. Failing to provide a value within the closed set will result in an error.

{\n    \"circle-translate-anchor\": \"viewport\"\n}\n
"},{"location":"types/#padding","title":"Padding","text":"SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS Single number 0.10.0 2.0.1 2.0.0 Array of numbers 2.2.0 \u274c (#2363) \u274c (#2363)

An array of numbers with syntax similar to CSS:

A single number is accepted for backwards-compatibility, and treated the same as a one-element array \u2014 padding applied to all sides.

The following example applies 2em padding on top and bottom and 3em padding left and right.

{\n    \"icon-padding\": [2, 3]\n}\n
"}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Introduction","text":"

A MapLibre style is a document that defines the visual appearance of a map: what data to draw, the order to draw it in, and how to style the data when drawing it. A style document is a JSON object with specific root level and nested properties. This specification defines and describes these properties.

The intended audience of this specification includes:

"},{"location":"#style-document-structure","title":"Style document structure","text":"

A MapLibre style consists of a set of root properties, some of which describe a single global property, and some of which contain nested properties. Some root properties, like version, name, and metadata, don\u2019t have any influence over the appearance or behavior of your map, but provide important descriptive information related to your map. Others, like layers and sources, are critical and determine which map features will appear on your map and what they will look like. Some properties, like center, zoom, pitch, and bearing, provide the map renderer with a set of defaults to be used when initially displaying the map.

"},{"location":"deprecations/","title":"Deprecations","text":"

Some style properties are no longer the preferred method of accomplishing a particular styling goal. While they are still supported, it is not recommended to use them in new styles as they may not function as intended when using both deprecated and non-deprecated style properties. The following is provided as reference for users who need to continue maintaining legacy styles while transitioning to preferred style properties. The gl-style-migrate tool can be used to migrate style files to the latest version and replace deprecated expressions with their supported equivalents.

In most cases of deprecated filters you should add a get and literal to convert from old to new syntax, for example [\">=\", \"count\", 5] should be converted to [\">=\", [\"get\", \"count\"], 5] and [\"in\", \"nature\", \"road\", \"highway\"] to [\"in\", [\"get\", \"nature\"], [\"literal\", [\"road\", \"highway\"]]].

"},{"location":"deprecations/#function","title":"Function","text":"

As of v0.41.0, property expressions is the preferred method for styling features based on zoom level or the feature's properties. Zoom and property functions are still supported but are not recommended.

The value for any layout or paint property may be specified as a function. Functions allow you to make the appearance of a map feature change with the current zoom level and/or the feature's properties.

"},{"location":"deprecations/#stops","title":"stops","text":"

Required (except for identity functions) array.

A set of one input value and one output value is a \"stop.\" Stop output values must be literal values (i.e. not functions or expressions), and appropriate for the property. For example, stop output values for a fill-color function property must be colors.

"},{"location":"deprecations/#property","title":"property","text":"

Optional string.

If specified, the function will take the specified feature property as an input. See Zoom Functions and Property Functions for more information.

"},{"location":"deprecations/#base","title":"base","text":"

Optional number. Default is 1.

The exponential base of the interpolation curve. It controls the rate at which the function output increases. Higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.

"},{"location":"deprecations/#type","title":"type","text":"

Optional string. One of identity, exponential, interval, or categorical.

identity: A function that returns its input as the output.

exponential: A function that generates an output by interpolating between stops just less than and just greater than the function input. The domain (input value) must be numeric, and the style property must support interpolation. Style properties that support interpolation are marked marked with, the \"exponential\" symbol, and exponential is the default function type for these properties.

interval: A function that returns the output value of the stop just less than the function input. The domain (input value) must be numeric. Any style property may use interval functions. For properties marked with, the \"interval\" symbol, this is the default function type.

categorical : A function that returns the output value of the stop equal to the function input.

"},{"location":"deprecations/#default","title":"default","text":"

A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:

If no default is provided, the style property's default is used in these circumstances.

"},{"location":"deprecations/#colorspace","title":"colorSpace","text":"

Optional string. One of rgb, lab, hcl.

The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.

rgb: Use the RGB color space to interpolate color values

lab: Use the LAB color space to interpolate color values.

hcl: Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 property 0.18.0 0.18.0 0.18.0 code 0.18.0 5.0.0 5.0.0 exponential type 0.18.0 5.0.0 3.5.0 interval type 0.18.0 5.0.0 3.5.0 categorical type 0.18.0 5.0.0 3.5.0 identity type 0.26.0 5.0.0 3.5.0 default 0.33.0 5.0.0 3.5.0 colorSpace 0.26.0"},{"location":"deprecations/#zoom-and-property-functions","title":"Zoom and Property functions","text":"

Zoom functions allow the appearance of a map feature to change with map\u2019s zoom level. Zoom functions can be used to create the illusion of depth and control data density. Each stop is an array with two elements: the first is a zoom level and the second is a function output value.

{\n    \"circle-radius\": {\n        \"stops\": [\n            // zoom is 5 -> circle radius will be 1px\n            [5, 1],\n            // zoom is 10 -> circle radius will be 2px\n            [10, 2]\n        ]\n    }\n}\n

The rendered values of color, number, and array properties are interpolated between stops. Boolean and string property values cannot be interpolated, so their rendered values only change at the specified stops.

There is an important difference between the way that zoom functions render for layout and paint properties. Paint properties are continuously re-evaluated whenever the zoom level changes, even fractionally. The rendered value of a paint property will change, for example, as the map moves between zoom levels 4.1 and 4.6. Layout properties, however, are evaluated only once for each integer zoom level. To continue the prior example: the rendering of a layout property will not change between zoom levels 4.1 and 4.6, no matter what stops are specified; but at zoom level 5, the function will be re-evaluated according to the function, and the property's rendered value will change. (You can include fractional zoom levels in a layout property zoom function, and it will affect the generated values; but, still, the rendering will only change at integer zoom levels.)

Property functions allow the appearance of a map feature to change with its properties. Property functions can be used to visually differentiate types of features within the same layer or create data visualizations. Each stop is an array with two elements, the first is a property input value and the second is a function output value. Note that support for property functions is not available across all properties and platforms.

{\n    \"circle-color\": {\n        \"property\": \"temperature\",\n        \"stops\": [\n            // \"temperature\" is 0   -> circle color will be blue\n            [0, 'blue'],\n            // \"temperature\" is 100 -> circle color will be red\n            [100, 'red']\n        ]\n    }\n}\n

Zoom-and-property functions allow the appearance of a map feature to change with both its properties and zoom. Each stop is an array with two elements, the first is an object with a property input value and a zoom, and the second is a function output value. Note that support for property functions is not yet complete.

{\n    \"circle-radius\": {\n        \"property\": \"rating\",\n        \"stops\": [\n            // zoom is 0 and \"rating\" is 0 -> circle radius will be 0px\n            [{zoom: 0, value: 0}, 0],\n\n            // zoom is 0 and \"rating\" is 5 -> circle radius will be 5px\n            [{zoom: 0, value: 5}, 5],\n\n            // zoom is 20 and \"rating\" is 0 -> circle radius will be 0px\n            [{zoom: 20, value: 0}, 0],\n\n            // zoom is 20 and \"rating\" is 5 -> circle radius will be 20px\n            [{zoom: 20, value: 5}, 20]\n        ]\n    }\n}\n
"},{"location":"deprecations/#other-filter","title":"Other filter","text":"

In previous versions of the style specification, filters were defined using the deprecated syntax documented below. Though filters defined with this syntax will continue to work, we recommend using the more flexible expressions syntax instead. Expression syntax and the deprecated syntax below cannot be mixed in a single filter definition.

"},{"location":"deprecations/#existential-filters","title":"Existential filters","text":"

[\"has\", key] feature[key] exists

[\"!has\", key] feature[key] does not exist

"},{"location":"deprecations/#comparison-filters","title":"Comparison filters","text":"

[\"==\", key, value] equality: feature[key] = value

[\"!=\", key, value] inequality: feature[key] \u2260 value

[\">\", key, value] greater than: feature[key] > value

[\">=\", key, value] greater than or equal: feature[key] \u2265 value

[\"<\", key, value] less than: feature[key] < value

[\"<=\", key, value] less than or equal: feature[key] \u2264 value

"},{"location":"deprecations/#set-membership-filters","title":"Set membership filters","text":"

[\"in\", key, v0, ..., vn] set inclusion: feature[key] \u2208 {v0, ..., vn}

[\"!in\", key, v0, ..., vn] set exclusion: feature[key] \u2209 { v0, ..., vn}

"},{"location":"deprecations/#combining-filters","title":"Combining filters","text":"

[\"all\", f0, ..., fn] logical AND: f0 \u2227 ... \u2227 fn

[\"any\", f0, ..., fn] logical OR: f0 \u2228 ... \u2228 fn

[\"none\",f0, ...,fn] logical NOR: \u00acf0 \u2227 ... \u2227 \u00acfn

A key must be a string that identifies a feature property, or one of the following special keys:

A value (and v0, ..., vn for set operators) must be a string, number, or boolean to compare the property value against.

Set membership filters are a compact and efficient way to test whether a field matches any of multiple values.

The comparison and set membership filters implement strictly-typed comparisons; for example, all of the following evaluate to false: 0 < \"1\", 2 == \"2\", \"true\" in [true, false].

The \"all\", \"any\", and \"none\" filter operators are used to create compound filters. The values f0, ..., fn must be filter expressions themselves.

[\"==\", \"$type\", \"LineString\"]\n

This filter requires that the class property of each feature is equal to either \"street_major\", \"street_minor\", or \"street_limited\".

[\"in\", \"class\", \"street_major\", \"street_minor\", \"street_limited\"]`\n

The combining filter \"all\" takes the three other filters that follow it and requires all of them to be true for a feature to be included: a feature must have a class equal to \"street_limited\", its admin_level must be greater than or equal to 3, and its type cannot be Polygon. You could change the combining filter to \"any\" to allow features matching any of those criteria to be included - features that are Polygons, but have a different class value, and so on.

[\n    \"all\",\n    [\"==\", \"class\", \"street_limited\"],\n    [\">=\", \"admin_level\", 3],\n    [\"!in\", \"$type\", \"Polygon\"]\n]\n
SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 has / !has 0.19.0 4.1.0 3.3.0"},{"location":"expressions/","title":"Expressions","text":"

The value for any layout property, paint property, or filter property may be specified as an expression. An expression defines a formula for computing the value of the property using the operators described below. The set of expression operators provided by MapLibre includes:

Expressions are represented as JSON arrays. The first element of an expression array is a string naming the expression operator, e.g. \"*\" or \"case\". Elements that follow (if any) are the arguments to the expression. Each argument is either a literal value (a string, number, boolean, or null), or another expression array.

[expression_name, argument_0, argument_1, ...]\n
"},{"location":"expressions/#data-expressions","title":"Data expressions","text":"

A data expression is any expression that access feature data -- that is, any expression that uses one of the data operators: get, has, id, geometry-type, properties, or feature-state. Data expressions allow a feature's properties or state to determine its appearance. They can be used to differentiate features within the same layer and to create data visualizations.

{\n    \"circle-color\": [\n        \"rgb\",\n        // red is higher when feature.properties.temperature is higher\n        [\"get\", \"temperature\"],\n        // green is always zero\n        0,\n        // blue is higher when feature.properties.temperature is lower\n        [\"-\", 100, [\"get\", \"temperature\"]]\n    ]\n}\n

This example uses the get operator to get the temperature value of each feature. That value is used to compute arguments to the rgb operator, defining a color in terms of its red, green, and blue components.

Data expressions are allowed as the value of the filter property, and as values for most paint and layout properties. However, some paint and layout properties do not yet support data expressions. The level of support is indicated by the \"data-driven styling\" row of the \"SDK Support\" table for each property. Data expressions with the feature-state operator are allowed only on paint properties.

"},{"location":"expressions/#camera-expressions","title":"Camera expressions","text":"

A camera expression is any expression that uses the zoom operator. Such expressions allow the appearance of a layer to change with the map's zoom level. Camera expressions can be used to create the appearance of depth and to control data density.

{\n    \"circle-radius\": [\n        \"interpolate\", [\"linear\"], [\"zoom\"],\n        // zoom is 5 (or less) -> circle radius will be 1px\n        5, 1,\n        // zoom is 10 (or greater) -> circle radius will be 5px\n        10, 5\n    ]\n}\n

This example uses the interpolate operator to define a linear relationship between zoom level and circle size using a set of input-output pairs. In this case, the expression indicates that the circle radius should be 1 pixel when the zoom level is 5 or below, and 5 pixels when the zoom is 10 or above. Between the two zoom levels, the circle radius will be linearly interpolated between 1 and 5 pixels

Camera expressions are allowed anywhere an expression may be used. When a camera expression used as the value of a layout or paint property, it must be in one of the following forms:

[ \"interpolate\", interpolation, [\"zoom\"], ... ]\n

Or:

[ \"step\", [\"zoom\"], ... ]\n

Or:

[\n    \"let\",\n    ... variable bindings...,\n    [ \"interpolate\", interpolation, [\"zoom\"], ... ]\n]\n

Or:

[\n    \"let\",\n    ... variable bindings...,\n    [ \"step\", [\"zoom\"], ... ]\n]\n

That is, in layout or paint properties, [\"zoom\"] may appear only as the input to an outer interpolate or step expression, or such an expression within a let expression.

There is an important difference between layout and paint properties in the timing of camera expression evaluation. Paint property camera expressions are re-evaluated whenever the zoom level changes, even fractionally. For example, a paint property camera expression will be re-evaluated continuously as the map moves between zoom levels 4.1 and 4.6. A layout property camera expression is evaluated only at integer zoom levels. It will not be re-evaluated as the zoom changes from 4.1 to 4.6 -- only if it goes above 5 or below 4.

"},{"location":"expressions/#composition","title":"Composition","text":"

A single expression may use a mix of data operators, camera operators, and other operators. Such composite expressions allows a layer's appearance to be determined by a combination of the zoom level and individual feature properties.

{\n    \"circle-radius\": [\n        \"interpolate\", [\"linear\"], [\"zoom\"],\n        // when zoom is 0, set each feature's circle radius to the value of its \"rating\" property\n        0, [\"get\", \"rating\"],\n        // when zoom is 10, set each feature's circle radius to four times the value of its \"rating\" property\n        10, [\"*\", 4, [\"get\", \"rating\"]]\n    ]\n}\n

An expression that uses both data and camera operators is considered both a data expression and a camera expression, and must adhere to the restrictions described above for both.

"},{"location":"expressions/#type-system","title":"Type system","text":"

The input arguments to expressions, and their result values, use the same set of types as the rest of the style specification: boolean, string, number, color, and arrays of these types. Furthermore, expressions are type safe: each use of an expression has a known result type and required argument types, and the SDKs verify that the result type of an expression is appropriate for the context in which it is used. For example, the result type of an expression in the filter property must be boolean, and the arguments to the \"+\" operator must be numbers.

When working with feature data, the type of a feature property value is typically not known ahead of time by the SDK. To preserve type safety, when evaluating a data expression, the SDK will check that the property value is appropriate for the context. For example, if you use the expression [\"get\", \"feature-color\"] for the circle-color property, the SDK will verify that the feature-color value of each feature is a string identifying a valid color. If this check fails, an error will be indicated in an SDK-specific way (typically a log message), and the default value for the property will be used instead.

In most cases, this verification will occur automatically wherever it is needed. However, in certain situations, the SDK may be unable to automatically determine the expected result type of a data expression from surrounding context. For example, it is not clear whether the expression [\"<\", [\"get\", \"a\"], [\"get\", \"b\"]] is attempting to compare strings or numbers. In situations like this, you can use one of the type assertion expression operators to indicate the expected type of a data expression: [\"<\", [\"number\", [\"get\", \"a\"]], [\"number\", [\"get\", \"b\"]]]. A type assertion checks that the feature data matches the expected type of the data expression. If this check fails, it produces an error and causes the whole expression to fall back to the default value for the property being defined. The assertion operators are array, boolean, number, and string.

Expressions perform only one kind of implicit type conversion: a data expression used in a context where a color is expected will convert a string representation of a color to a color value. In all other cases, if you want to convert between types, you must use one of the type conversion expression operators: to-boolean, to-number, to-string, or to-color. For example, if you have a feature property that stores numeric values in string format, and you want to use those values as numbers rather than strings, you can use an expression such as [\"to-number\", [\"get\", \"property-name\"]].

If an expression accepts an array argument and the user supplies an array literal, that array must be wrapped in a literal expression (see the examples below). When GL-JS encounters an array in a style-spec property value, it will assume that the array is an expression and try to parse it; the library has no way to distinguish between an expression which failed validation and an array literal unless the developer makes this distinction explicit with the literal operator. The literal operator is not necessary if the array is returned from a sub-expression, e.g. [\"in\", 1, [\"get\", \"myArrayProp\"]].

// will throw an error\n{\n    \"circle-color\": [\"in\", 1, [1, 2, 3]]\n}\n\n// will work as expected\n{\n    \"circle-color\": [\"in\", 1, [\"literal\", [1, 2, 3]]]\n}\n
"},{"location":"expressions/#variable-binding","title":"Variable binding","text":""},{"location":"expressions/#let","title":"let","text":"

Binds expressions to named variables, which can then be referenced in the result expression using [\"var\", \"variable_name\"].

Syntax:

[\"let\", string, value, expression]: value\n

Example:

\"some-property\": [\n    \"let\",\n    \"someNumber\",\n    500,\n    [\n        \"interpolate\",\n        [\"linear\"],\n        [\"var\", \"someNumber\"],\n        274,\n        \"#edf8e9\",\n        1551,\n        \"#006d2c\"\n    ]\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#var","title":"var","text":"

References variable bound using let.

Syntax:

[\"var\", string]: value\n

Example:

\"some-property\": [\"var\", \"density\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#types","title":"Types","text":""},{"location":"expressions/#literal","title":"literal","text":"

Provides a literal array or object value.

Syntax:

[\"literal\", JSON object or array]: array | object\n

Example:

\"some-property\": [\n    \"literal\",\n    [\"DIN Offc Pro Italic\", \"Arial Unicode MS Regular\"]\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#array","title":"array","text":"

Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.

Syntax:

[\"array\", value, string?, number?]: array\n

Example:

\"some-property\": [\"array\", [\"literal\", [\"a\", \"b\", \"c\"]], \"string\", 3]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#typeof","title":"typeof","text":"

Returns a string describing the type of the given value.

Syntax:

[\"typeof\", value]: string\n

Example:

\"some-property\": [\"typeof\", [\"get\", \"name\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#string","title":"string","text":"

Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.

Syntax:

[\"string\", value, fallback: value, fallback: value, ...]: string\n

Example:

\"some-property\": [\"string\", [\"get\", \"name\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#number","title":"number","text":"

Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.

Syntax:

[\"number\", value, fallback: value, fallback: value, ...]: number\n

Example:

\"some-property\": [\"number\", [\"get\", \"population\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#boolean","title":"boolean","text":"

Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.

Syntax:

[\"boolean\", value, fallback: value, fallback: value, ...]: boolean\n

Example:

\"some-property\": [\"boolean\", [\"feature-state\", \"hover\"], false]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#object","title":"object","text":"

Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.

Syntax:

[\"object\", value, fallback: value, fallback: value, ...]: object\n

Example:

\"some-property\": [\"object\", [\"get\", \"some-property\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#collator","title":"collator","text":"

Returns a collator for use in locale-dependent comparison operations. The case-sensitive and diacritic-sensitive options default to false. The locale argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the collator will use a system-defined fallback locale. Use resolved-locale to test the results of locale fallback behavior.

Syntax:

[\"collator\", collator, { \"case-sensitive\": boolean, \"diacritic-sensitive\": boolean, \"locale\": string }]: collator\n

Example:

\"some-property\": [\n    \"collator\",\n    {\n        \"case-sensitive\": true,\n        \"diacritic-sensitive\": true,\n        \"locale\": \"fr\"\n    }\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.45.0 6.5.0 4.2.0"},{"location":"expressions/#format","title":"format","text":"

Returns a formatted string for displaying mixed-format text in the text-field property. The input may contain a string literal or expression, including an 'image' expression. Strings may be followed by a style override object that supports the following properties:

Syntax:

[\"format\", value, { \"text-font\": string, \"text-color\": color, \"font-scale\": number }, ...]: formatted\n

Example:

\"some-property\": [\n    \"format\",\n    [\"upcase\", [\"get\", \"FacilityName\"]],\n    {\"font-scale\": 0.8},\n    \"\\n\\n\",\n    {},\n    [\"downcase\", [\"get\", \"Comments\"]],\n    {\"font-scale\": 0.6}\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.48.0 6.7.0 4.6.0 text-font 0.48.0 6.7.0 4.6.0 font-scale 0.48.0 6.7.0 4.6.0 text-color 1.3.0 7.3.0 4.10.0 image 1.6.0 8.6.0 5.7.0"},{"location":"expressions/#image","title":"image","text":"

Returns an image type for use in icon-image, *-pattern entries and as a section in the format expression. If set, the image argument will check that the requested image exists in the style and will return either the resolved image name or null, depending on whether or not the image is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the image argument.

Syntax:

[\"image\", value]: image\n

Example:

\"some-property\": [\"image\", \"marker_15\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 1.4.0 8.6.0 5.7.0"},{"location":"expressions/#number-format","title":"number-format","text":"

Converts the input number into a string representation using the providing formatting rules. If set, the locale argument specifies the locale to use, as a BCP 47 language tag. If set, the currency argument specifies an ISO 4217 code to use for currency-style formatting. If set, the min-fraction-digits and max-fraction-digits arguments specify the minimum and maximum number of fractional digits to include.

Syntax:

[\"number-format\", number, { \"locale\": string, \"currency\": string, \"min-fraction-digits\": number, \"max-fraction-digits\": number }]: string\n

Example:

\"some-property\": [\n    \"number-format\",\n    [\"get\", \"mag\"],\n    {\"min-fraction-digits\": 1, \"max-fraction-digits\": 1}\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.54.0 8.4.0 \u2705"},{"location":"expressions/#to-string","title":"to-string","text":"

Converts the input value to a string. If the input is null, the result is \"\". If the input is a boolean, the result is \"true\" or \"false\". If the input is a number, it is converted to a string as specified by the \"NumberToString\" algorithm of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form \"rgba(r,g,b,a)\", where r, g, and b are numerals ranging from 0 to 255, and a ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the JSON.stringify function of the ECMAScript Language Specification.

Syntax:

[\"to-string\", value]: string\n

Example:

\"some-property\": [\"to-string\", [\"get\", \"mag\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#to-number","title":"to-number","text":"

Converts the input value to a number, if possible. If the input is null or false, the result is 0. If the input is true, the result is 1. If the input is a string, it is converted to a number as specified by the \"ToNumber Applied to the String Type\" algorithm of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.

Syntax:

[\"to-number\", value, fallback: value, fallback: value, ...]: number\n

Example:

\"some-property\": [\"to-number\", \"someProperty\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#to-boolean","title":"to-boolean","text":"

Converts the input value to a boolean. The result is false when then input is an empty string, 0, false, null, or NaN; otherwise it is true.

Syntax:

[\"to-boolean\", value]: boolean\n

Example:

\"some-property\": [\"to-boolean\", \"someProperty\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#to-color","title":"to-color","text":"

Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.

Syntax:

[\"to-color\", value, fallback: value, fallback: value, ...]: color\n

Example:

\"some-property\": [\"to-color\", \"#edf8e9\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#lookup","title":"Lookup","text":""},{"location":"expressions/#at","title":"at","text":"

Retrieves an item from an array.

Syntax:

[\"at\", number, value]: value\n

Example:

\"some-property\": [\"at\", 1, [\"literal\", [\"a\", \"b\", \"c\"]]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#in","title":"in","text":"

Determines whether an item exists in an array or a substring exists in a string.

Syntax:

[\"in\", value, value]: boolean\n

Example:

\"some-property\": [\"in\", \"$type\", \"Point\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 1.6.0 9.1.0 5.8.0"},{"location":"expressions/#index-of","title":"index-of","text":"

Returns the first position at which an item can be found in an array or a substring can be found in a string, or -1 if the input cannot be found. Accepts an optional index from where to begin the search. In a string, a UTF-16 surrogate pair counts as a single position.

Syntax:

[\"index-of\", value, value, number?]: number\n

Example:

\"some-property\": [\"index-of\", \"foo\", [\"baz\", \"bar\", \"hello\", \"foo\", \"world\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 1.10.0 10.3.0 6.0.0"},{"location":"expressions/#slice","title":"slice","text":"

Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index. In a string, a UTF-16 surrogate pair counts as a single position.

Syntax:

[\"slice\", value, number, number?]: value\n

Example:

\"some-property\": [\"slice\", [\"get\", \"name\"], 0, 3]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 1.10.0 10.3.0 6.0.0"},{"location":"expressions/#get","title":"get","text":"

Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.

Syntax:

[\"get\", string]: value\n

Example:

\"some-property\": [\"get\", \"someProperty\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#has","title":"has","text":"

Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.

Syntax:

[\"has\", string]: boolean\n

Example:

\"some-property\": [\"has\", \"someProperty\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#length","title":"length","text":"

Gets the length of an array or string. In a string, a UTF-16 surrogate pair counts as a single position.

Syntax:

[\"length\", array]: number\n

Example:

\"some-property\": [\"length\", [\"get\", \"myArray\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#decision","title":"Decision","text":""},{"location":"expressions/#case","title":"case","text":"

Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.

Syntax:

[\"case\", value, value, ..., fallback: value]: value\n

Example:

\"some-property\": [\n    \"case\",\n    [\"boolean\", [\"feature-state\", \"hover\"], false],\n    1,\n    0.5\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#match","title":"match","text":"

Selects the output whose label value matches the input value, or the fallback value if no match is found. The input can be any expression (e.g. [\"get\", \"building_type\"]). Each label must be either:

Each label must be unique. If the input type does not match the type of the labels, the result will be the fallback value.

Syntax:

[\"match\", value, value, ..., fallback: value]: value\n

Example:

\"some-property\": [\n    \"match\",\n    [\"get\", \"building_type\"],\n    \"residential\",\n    \"#f00\",\n    \"commercial\",\n    \"#0f0\",\n    \"#000\"\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#coalesce","title":"coalesce","text":"

Evaluates each expression in turn until the first non-null value is obtained, and returns that value.

Syntax:

[\"coalesce\", coalesce, value, fallback]: value\n

Example:

\"some-property\": [\n    \"coalesce\",\n    [\"image\", [\"concat\", [\"get\", \"icon\"], \"_15\"]],\n    [\"image\", \"marker_15\"]\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#_1","title":"==","text":"

Returns true if the input values are equal, false otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional collator argument to control locale-dependent string comparisons.

Syntax:

[\"==\", value, value, collator?]: boolean\n

Example:

\"some-property\": [\"==\", \"$type\", \"Polygon\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0 collator 0.45.0 6.5.0 4.2.0"},{"location":"expressions/#_2","title":"!=","text":"

Returns true if the input values are not equal, false otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional collator argument to control locale-dependent string comparisons.

Syntax:

[\"!=\", value, value, collator?]: boolean\n

Example:

\"some-property\": [\"!=\", \"cluster\", true]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0 collator 0.45.0 6.5.0 4.2.0"},{"location":"expressions/#_3","title":">","text":"

Returns true if the first input is strictly greater than the second, false otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional collator argument to control locale-dependent string comparisons.

Syntax:

[\">\", value, value, collator?]: boolean\n

Example:

\"some-property\": [\">\", [\"get\", \"mag\"], 2]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0 collator 0.45.0 6.5.0 4.2.0"},{"location":"expressions/#_4","title":"<","text":"

Returns true if the first input is strictly less than the second, false otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional collator argument to control locale-dependent string comparisons.

Syntax:

[\"<\", value, value, collator?]: boolean\n

Example:

\"some-property\": [\"<\", [\"get\", \"mag\"], 2]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0 collator 0.45.0 6.5.0 4.2.0"},{"location":"expressions/#_5","title":">=","text":"

Returns true if the first input is greater than or equal to the second, false otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional collator argument to control locale-dependent string comparisons.

Syntax:

[\">=\", value, value, collator?]: boolean\n

Example:

\"some-property\": [\">=\", [\"get\", \"mag\"], 6]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0 collator 0.45.0 6.5.0 4.2.0"},{"location":"expressions/#_6","title":"<=","text":"

Returns true if the first input is less than or equal to the second, false otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional collator argument to control locale-dependent string comparisons.

Syntax:

[\"<=\", value, value, collator?]: boolean\n

Example:

\"some-property\": [\"<=\", [\"get\", \"mag\"], 6]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0 collator 0.45.0 6.5.0 4.2.0"},{"location":"expressions/#all","title":"all","text":"

Returns true if all the inputs are true, false otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to false, the result is false and no further input expressions are evaluated.

Syntax:

[\"all\", boolean, boolean, ...]: boolean\n

Example:

\"some-property\": [\"all\", [\">=\", [\"get\", \"mag\"], 4], [\"<\", [\"get\", \"mag\"], 5]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#any","title":"any","text":"

Returns true if any of the inputs are true, false otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to true, the result is true and no further input expressions are evaluated.

Syntax:

[\"any\", boolean, boolean, ...]: boolean\n

Example:

\"some-property\": [\"any\", [\">=\", [\"get\", \"mag\"], 4], [\"<\", [\"get\", \"mag\"], 5]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#_7","title":"!","text":"

Logical negation. Returns true if the input is false, and false if the input is true.

Syntax:

[\"!\", value, value, collator?]: boolean\n

Example:

\"some-property\": [\"!\", [\"has\", \"point_count\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#within","title":"within","text":"

Returns true if the evaluated feature is fully contained inside a boundary of the input geometry, false otherwise. The input value can be a valid GeoJSON of type Polygon, MultiPolygon, Feature, or FeatureCollection. Supported features for evaluation:

Syntax:

[\"within\", GeoJSON geometry]: boolean\n

Example:

\"some-property\": [\n    \"within\",\n    {\n        \"type\": \"Polygon\",\n        \"coordinates\": [\n            [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]\n        ]\n    }\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 1.9.0 9.1.0 5.8.0"},{"location":"expressions/#ramps-scales-curves","title":"Ramps, scales, curves","text":""},{"location":"expressions/#step","title":"step","text":"

Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values (\"stops\"). The input may be any numeric expression (e.g., [\"get\", \"population\"]). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.

Syntax:

[\"step\", step, number, number, number, ...]: number\n

Example:

\"some-property\": [\"step\", [\"get\", \"point_count\"], 20, 100, 30, 750, 40]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.42.0 6.0.0 4.0.0"},{"location":"expressions/#interpolate","title":"interpolate","text":"

Produces continuous, smooth results by interpolating between pairs of input and output values (\"stops\"). The input may be any numeric expression (e.g., [\"get\", \"population\"]). Stop inputs must be numeric literals in strictly ascending order. The output type must be number, array<number>, or color.

Interpolation types:

Syntax:

[\"interpolate\", [\"linear\"] | [\"exponential\", base] | [\"cubic-bezier\", x1, y1, x2, y2], number, number, number, ...]: number | array<number> | color\n

Example:

\"some-property\": [\n    \"interpolate\",\n    [\"linear\"],\n    [\"zoom\"],\n    15,\n    0,\n    15.05,\n    [\"get\", \"height\"]\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.42.0 6.0.0 4.0.0"},{"location":"expressions/#interpolate-hcl","title":"interpolate-hcl","text":"

Produces continuous, smooth results by interpolating between pairs of input and output values (\"stops\"). Works like interpolate, but the output type must be color, and the interpolation is performed in the Hue-Chroma-Luminance color space.

Syntax:

[\"interpolate-hcl\", [\"linear\"] | [\"exponential\", base] | [\"cubic-bezier\", x1, y1, x2, y2], number, number, number, ...]: color\n

Example:

\"some-property\": [\n    \"interpolate-hcl\",\n    [\"linear\"],\n    [\"zoom\"],\n    15,\n    \"#f00\",\n    15.05,\n    \"#00f\"\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.49.0 \u274c (#2784) \u274c (#2784)"},{"location":"expressions/#interpolate-lab","title":"interpolate-lab","text":"

Produces continuous, smooth results by interpolating between pairs of input and output values (\"stops\"). Works like interpolate, but the output type must be color, and the interpolation is performed in the CIELAB color space.

Syntax:

[\"interpolate-lab\", [\"linear\"] | [\"exponential\", base] | [\"cubic-bezier\", x1, y1, x2, y2], number, number, number, ...]: color\n

Example:

\"some-property\": [\n    \"interpolate-lab\",\n    [\"linear\"],\n    [\"zoom\"],\n    15,\n    \"#f00\",\n    15.05,\n    \"#00f\"\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.49.0 \u274c (#2784) \u274c (#2784)"},{"location":"expressions/#math","title":"Math","text":""},{"location":"expressions/#ln2","title":"ln2","text":"

Returns mathematical constant ln(2).

Syntax:

[\"ln2\"]: number\n

Example:

\"some-property\": [\"ln2\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#pi","title":"pi","text":"

Returns the mathematical constant pi.

Syntax:

[\"pi\"]: number\n

Example:

\"some-property\": [\"pi\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#e","title":"e","text":"

Returns the mathematical constant e.

Syntax:

[\"e\"]: number\n

Example:

\"some-property\": [\"e\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#_8","title":"+","text":"

Returns the sum of the inputs.

Syntax:

[\"+\", number, number, ...]: number\n

Example:

\"some-property\": [\"+\", 2, 3]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#_9","title":"*","text":"

Returns the product of the inputs.

Syntax:

[\"*\", number, number, ...]: number\n

Example:

\"some-property\": [\"*\", 2, 3]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#-","title":"-","text":"

For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.

Syntax:

[\"-\", number, number?]: number\n

Example:

\"some-property\": [\"-\", 10]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#_10","title":"/","text":"

Returns the result of floating point division of the first input by the second.

Syntax:

[\"/\", number, number]: number\n

Example:

\"some-property\": [\"/\", [\"get\", \"population\"], [\"get\", \"sq-km\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#_11","title":"%","text":"

Returns the remainder after integer division of the first input by the second.

Syntax:

[\"%\", number, number]: number\n

Example:

\"some-property\": [\"%\", 10, 3]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#_12","title":"^","text":"

Returns the result of raising the first input to the power specified by the second.

Syntax:

[\"^\", number, number]: number\n

Example:

\"some-property\": [\"^\", 2, 3]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#sqrt","title":"sqrt","text":"

Returns the square root of the input.

Syntax:

[\"sqrt\", number]: number\n

Example:

\"some-property\": [\"sqrt\", 9]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.42.0 6.0.0 4.0.0"},{"location":"expressions/#log10","title":"log10","text":"

Returns the base-ten logarithm of the input.

Syntax:

[\"log10\", number]: number\n

Example:

\"some-property\": [\"log10\", 8]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#ln","title":"ln","text":"

Returns the natural logarithm of the input.

Syntax:

[\"ln\", number]: number\n

Example:

\"some-property\": [\"ln\", 8]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#log2","title":"log2","text":"

Returns the base-two logarithm of the input.

Syntax:

[\"log2\", number]: number\n

Example:

\"some-property\": [\"log2\", 8]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#sin","title":"sin","text":"

Returns the sine of the input.

Syntax:

[\"sin\", number]: number\n

Example:

\"some-property\": [\"sin\", 1]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#cos","title":"cos","text":"

Returns the cosine of the input.

Syntax:

[\"cos\", number]: number\n

Example:

\"some-property\": [\"cos\", 1]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#tan","title":"tan","text":"

Returns the tangent of the input.

Syntax:

[\"tan\", number]: number\n

Example:

\"some-property\": [\"tan\", 1]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#asin","title":"asin","text":"

Returns the arcsine of the input.

Syntax:

[\"asin\", number]: number\n

Example:

\"some-property\": [\"asin\", 1]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#acos","title":"acos","text":"

Returns the arccosine of the input.

Syntax:

[\"acos\", number]: number\n

Example:

\"some-property\": [\"acos\", 1]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#atan","title":"atan","text":"

Returns the arctangent of the input.

Syntax:

[\"atan\", number]: number\n

Example:

\"some-property\": [\"atan\", 1]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#min","title":"min","text":"

Returns the minimum value of the inputs.

Syntax:

[\"min\", number, number, ...]: number\n

Example:

\"some-property\": [\"min\", 1, 2]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#max","title":"max","text":"

Returns the maximum value of the inputs.

Syntax:

[\"max\", number, number, ...]: number\n

Example:

\"some-property\": [\"max\", 1, 2]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#round","title":"round","text":"

Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, [\"round\", -1.5] evaluates to -2.

Syntax:

[\"round\", number]: number\n

Example:

\"some-property\": [\"round\", 1.5]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.45.0 6.0.0 4.0.0"},{"location":"expressions/#abs","title":"abs","text":"

Returns the absolute value of the input.

Syntax:

[\"abs\", number]: number\n

Example:

\"some-property\": [\"abs\", -1.5]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.45.0 6.0.0 4.0.0"},{"location":"expressions/#ceil","title":"ceil","text":"

Returns the smallest integer that is greater than or equal to the input.

Syntax:

[\"ceil\", number]: number\n

Example:

\"some-property\": [\"ceil\", 1.5]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.45.0 6.0.0 4.0.0"},{"location":"expressions/#floor","title":"floor","text":"

Returns the largest integer that is less than or equal to the input.

Syntax:

[\"floor\", number]: number\n

Example:

\"some-property\": [\"floor\", 1.5]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.45.0 6.0.0 4.0.0"},{"location":"expressions/#distance","title":"distance","text":"

Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, Feature, or FeatureCollection. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.

Syntax:

[\"distance\", GeoJSON geometry]: number\n

Example:

\"some-property\": [\"distance\", {\"type\": \"Point\", \"coordinates\": [0, 0]}]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 4.2.0 9.2.0 5.9.0"},{"location":"expressions/#color","title":"Color","text":""},{"location":"expressions/#to-rgba","title":"to-rgba","text":"

Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.

Syntax:

[\"to-rgba\", color]: array\n

Example:

\"some-property\": [\"to-rgba\", \"#ff0000\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#rgb","title":"rgb","text":"

Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.

Syntax:

[\"rgb\", number, number, number]: color\n

Example:

\"some-property\": [\"rgb\", 255, 0, 0]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#rgba","title":"rgba","text":"

Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.

Syntax:

[\"rgba\", number, number, number, number]: color\n

Example:

\"some-property\": [\"rgba\", 255, 0, 0, 1]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#feature-data","title":"Feature data","text":""},{"location":"expressions/#properties","title":"properties","text":"

Gets the feature properties object. Note that in some cases, it may be more efficient to use [\"get\", \"property_name\"] directly.

Syntax:

[\"properties\"]: value\n

Example:

\"some-property\": [\"properties\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#feature-state","title":"feature-state","text":"

Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. When source.promoteId is not provided, features are identified by their id attribute, which must be an integer or a string that can be cast to an integer. When source.promoteId is provided, features are identified by their promoteId property, which may be a number, string, or any primitive data type. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.

Syntax:

[\"feature-state\", string]: value\n

Example:

\"some-property\": [\"feature-state\", \"hover\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.46.0 \u274c (#1698) \u274c (#1698)"},{"location":"expressions/#geometry-type","title":"geometry-type","text":"

Gets the feature's geometry type: Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon.

Syntax:

[\"geometry-type\"]: string\n

Example:

\"some-property\": [\"==\", [\"geometry-type\"], \"Polygon\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#id","title":"id","text":"

Gets the feature's id, if it has one.

Syntax:

[\"id\"]: value\n

Example:

\"some-property\": [\"id\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#line-progress","title":"line-progress","text":"

Gets the progress along a gradient line. Can only be used in the line-gradient property.

Syntax:

[\"line-progress\", number]: number\n

Example:

\"some-property\": [\"line-progress\", 0.5]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.45.0 6.5.0 4.6.0"},{"location":"expressions/#accumulated","title":"accumulated","text":"

Gets the value of a cluster property accumulated so far. Can only be used in the clusterProperties option of a clustered GeoJSON source.

Syntax:

[\"accumulated\", string]: value\n

Example:

\"some-property\": [\"accumulated\", \"sum\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.53.0 \u2705 \u2705"},{"location":"expressions/#zoom","title":"Zoom","text":""},{"location":"expressions/#zoom_1","title":"zoom","text":"

Gets the current zoom level. Note that in style layout and paint properties, [\"zoom\"] may only appear as the input to a top-level \"step\" or \"interpolate\" expression.

Syntax:

[\"zoom\"]: number\n

Example:

\"some-property\": [\n    \"interpolate\",\n    [\"linear\"],\n    [\"zoom\"],\n    15,\n    0,\n    15.05,\n    [\"get\", \"height\"]\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#heatmap","title":"Heatmap","text":""},{"location":"expressions/#heatmap-density","title":"heatmap-density","text":"

Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the heatmap-color property.

Syntax:

[\"heatmap-density\"]: number\n

Example:

\"some-property\": [\"heatmap-density\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#string_1","title":"String","text":""},{"location":"expressions/#is-supported-script","title":"is-supported-script","text":"

Returns true if the input string is expected to render legibly. Returns false if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the mapbox-gl-rtl-text plugin is not in use in MapLibre GL JS).

Syntax:

[\"is-supported-script\", string]: boolean\n

Example:

\"some-property\": [\"is-supported-script\", \"\u0926\u093f\u0932\u094d\u0932\u0940\"]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.45.0 6.6.0 \u2705"},{"location":"expressions/#upcase","title":"upcase","text":"

Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.

Syntax:

[\"upcase\", string]: string\n

Example:

\"some-property\": [\"upcase\", [\"get\", \"name\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#downcase","title":"downcase","text":"

Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.

Syntax:

[\"downcase\", string]: string\n

Example:

\"some-property\": [\"downcase\", [\"get\", \"name\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#concat","title":"concat","text":"

Returns a string consisting of the concatenation of the inputs. Each input is converted to a string as if by to-string.

Syntax:

[\"concat\", string, string, ...]: string\n

Example:

\"some-property\": [\"concat\", \"square-rgb-\", [\"get\", \"color\"]]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"expressions/#resolved-locale","title":"resolved-locale","text":"

Returns the IETF language tag of the locale being used by the provided collator. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.

Syntax:

[\"resolved-locale\", collator]: string\n

Example:

\"some-property\": [\n    \"resolved-locale\",\n    [\n        \"collator\",\n        {\n            \"case-sensitive\": true,\n            \"diacritic-sensitive\": false,\n            \"locale\": \"de\"\n        }\n    ]\n]\n

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.45.0 6.5.0 4.2.0"},{"location":"glyphs/","title":"Glyphs","text":"

A URL template for loading signed-distance-field glyph sets in PBF format.

The URL must include:

This property is required if any layer uses the text-field layout property. The URL must be absolute, containing the scheme, authority and path components.

glyphs: \"https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf\"\n
"},{"location":"layers/","title":"Layers","text":"

A style's layers property lists all the layers available in that style. The type of layer is specified by the type property, and must be one of background, fill, line, symbol, raster, circle, fill-extrusion, heatmap, hillshade.

Except for layers of the background type, each layer needs to refer to a source. Layers take the data that they get from a source, optionally filter features, and then define how those features are styled.

layers: [\n    {\n        \"id\": \"coastline\",\n        \"source\": \"maplibre\",\n        \"source-layer\": \"contries\",\n        \"type\": \"line\",\n        \"paint\": {\"line-color\": \"#198EC8\"}\n    }\n]\n
"},{"location":"layers/#layer-properties","title":"Layer Properties","text":""},{"location":"layers/#id","title":"id","text":"

Required string.

Unique layer name.

"},{"location":"layers/#type","title":"type","text":"

Required enum. Possible values: fill, line, symbol, circle, heatmap, fill-extrusion, raster, hillshade, background.

Rendering type of this layer.

"},{"location":"layers/#metadata","title":"metadata","text":"

Optional.

Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'maplibre:'.

metadata: {\"source:comment\": \"Hydrology FCCODE 460 - Narrow wash\"}\n
"},{"location":"layers/#source","title":"source","text":"

Optional string.

Name of a source description to be used for this layer. Required for all layer types except background.

"},{"location":"layers/#source-layer","title":"source-layer","text":"

Optional string.

Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources.

"},{"location":"layers/#minzoom","title":"minzoom","text":"

Optional number in range [0, 24].

The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden.

"},{"location":"layers/#maxzoom","title":"maxzoom","text":"

Optional number in range [0, 24].

The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden.

"},{"location":"layers/#filter","title":"filter","text":"

Optional filter.

A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The feature-state expression is not supported in filter expressions.

"},{"location":"layers/#layout","title":"layout","text":"

Optional layout.

Layout properties for the layer.

"},{"location":"layers/#paint","title":"paint","text":"

Optional paint.

Default paint properties for this layer.

"},{"location":"layers/#background","title":"Background","text":""},{"location":"layers/#visibility","title":"visibility","text":"

Layout property. Optional enum. Possible values: visible, none. Defaults to visible.

Whether this layer is displayed.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#background-color","title":"background-color","text":"

Paint property. Optional color. Defaults to #000000. Disabled by background-pattern. Supports interpolate expressions. Transitionable.

The color with which the background will be drawn.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#background-pattern","title":"background-pattern","text":"

Paint property. Optional resolvedImage. Transitionable.

Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling Not supported yet Not supported yet Not supported yet"},{"location":"layers/#background-opacity","title":"background-opacity","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Supports interpolate expressions. Transitionable.

The opacity at which the background will be drawn.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#fill","title":"Fill","text":""},{"location":"layers/#fill-sort-key","title":"fill-sort-key","text":"

Layout property. Optional number.

Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 1.2.0 9.1.0 5.8.0 data-driven styling 1.2.0 9.1.0 5.8.0"},{"location":"layers/#visibility_1","title":"visibility","text":"

Layout property. Optional enum. Possible values: visible, none. Defaults to visible.

Whether this layer is displayed.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#fill-antialias","title":"fill-antialias","text":"

Paint property. Optional boolean. Defaults to true.

Whether or not the fill should be antialiased.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#fill-opacity","title":"fill-opacity","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Supports feature-state and interpolate expressions. Transitionable.

The opacity of the entire fill layer. In contrast to the fill-color, this value will also affect the 1px stroke around the fill, if the stroke is used.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.21.0 5.0.0 3.5.0"},{"location":"layers/#fill-color","title":"fill-color","text":"

Paint property. Optional color. Defaults to #000000. Disabled by fill-pattern. Supports feature-state and interpolate expressions. Transitionable.

The color of the filled part of this layer. This color can be specified as rgba with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.19.0 5.0.0 3.5.0"},{"location":"layers/#fill-outline-color","title":"fill-outline-color","text":"

Paint property. Optional color. Disabled by fill-pattern. Requires fill-antialias to be true. Supports feature-state and interpolate expressions. Transitionable.

The outline color of the fill. Matches the value of fill-color if unspecified.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.19.0 5.0.0 3.5.0"},{"location":"layers/#fill-translate","title":"fill-translate","text":"

Paint property. Optional array. Units in pixels. Defaults to 0,0. Supports interpolate expressions. Transitionable.

The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#fill-translate-anchor","title":"fill-translate-anchor","text":"

Paint property. Optional enum. Possible values: map, viewport. Defaults to map. Requires fill-translate.

Controls the frame of reference for fill-translate.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#fill-pattern","title":"fill-pattern","text":"

Paint property. Optional resolvedImage. Transitionable.

Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.49.0 6.5.0 4.4.0"},{"location":"layers/#circle","title":"Circle","text":""},{"location":"layers/#circle-sort-key","title":"circle-sort-key","text":"

Layout property. Optional number.

Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 1.2.0 9.2.0 5.9.0 data-driven styling 1.2.0 9.2.0 5.9.0"},{"location":"layers/#visibility_2","title":"visibility","text":"

Layout property. Optional enum. Possible values: visible, none. Defaults to visible.

Whether this layer is displayed.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#circle-radius","title":"circle-radius","text":"

Paint property. Optional number in range [0, \u221e). Units in pixels. Defaults to 5. Supports feature-state and interpolate expressions. Transitionable.

Circle radius.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.18.0 5.0.0 3.5.0"},{"location":"layers/#circle-color","title":"circle-color","text":"

Paint property. Optional color. Defaults to #000000. Supports feature-state and interpolate expressions. Transitionable.

The fill color of the circle.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.18.0 5.0.0 3.5.0"},{"location":"layers/#circle-blur","title":"circle-blur","text":"

Paint property. Optional number. Defaults to 0. Supports feature-state and interpolate expressions. Transitionable.

Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.20.0 5.0.0 3.5.0"},{"location":"layers/#circle-opacity","title":"circle-opacity","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Supports feature-state and interpolate expressions. Transitionable.

The opacity at which the circle will be drawn.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.20.0 5.0.0 3.5.0"},{"location":"layers/#circle-translate","title":"circle-translate","text":"

Paint property. Optional array. Units in pixels. Defaults to 0,0. Supports interpolate expressions. Transitionable.

The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#circle-translate-anchor","title":"circle-translate-anchor","text":"

Paint property. Optional enum. Possible values: map, viewport. Defaults to map. Requires circle-translate.

Controls the frame of reference for circle-translate.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#circle-pitch-scale","title":"circle-pitch-scale","text":"

Paint property. Optional enum. Possible values: map, viewport. Defaults to map.

Controls the scaling behavior of the circle when the map is pitched.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.21.0 4.2.0 3.4.0"},{"location":"layers/#circle-pitch-alignment","title":"circle-pitch-alignment","text":"

Paint property. Optional enum. Possible values: map, viewport. Defaults to viewport.

Orientation of circle when map is pitched.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.39.0 5.2.0 3.7.0"},{"location":"layers/#circle-stroke-width","title":"circle-stroke-width","text":"

Paint property. Optional number in range [0, \u221e). Units in pixels. Defaults to 0. Supports feature-state and interpolate expressions. Transitionable.

The width of the circle's stroke. Strokes are placed outside of the circle-radius.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.29.0 5.0.0 3.5.0 data-driven styling 0.29.0 5.0.0 3.5.0"},{"location":"layers/#circle-stroke-color","title":"circle-stroke-color","text":"

Paint property. Optional color. Defaults to #000000. Supports feature-state and interpolate expressions. Transitionable.

The stroke color of the circle.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.29.0 5.0.0 3.5.0 data-driven styling 0.29.0 5.0.0 3.5.0"},{"location":"layers/#circle-stroke-opacity","title":"circle-stroke-opacity","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Supports feature-state and interpolate expressions. Transitionable.

The opacity of the circle's stroke.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.29.0 5.0.0 3.5.0 data-driven styling 0.29.0 5.0.0 3.5.0"},{"location":"layers/#heatmap","title":"Heatmap","text":""},{"location":"layers/#visibility_3","title":"visibility","text":"

Layout property. Optional enum. Possible values: visible, none. Defaults to visible.

Whether this layer is displayed.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"layers/#heatmap-radius","title":"heatmap-radius","text":"

Paint property. Optional number in range [1, \u221e). Units in pixels. Defaults to 30. Supports feature-state and interpolate expressions. Transitionable.

Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0 data-driven styling 0.43.0 6.0.0 4.0.0"},{"location":"layers/#heatmap-weight","title":"heatmap-weight","text":"

Paint property. Optional number in range [0, \u221e). Defaults to 1. Supports feature-state and interpolate expressions.

A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0 data-driven styling 0.41.0 6.0.0 4.0.0"},{"location":"layers/#heatmap-intensity","title":"heatmap-intensity","text":"

Paint property. Optional number in range [0, \u221e). Defaults to 1. Supports interpolate expressions. Transitionable.

Similar to heatmap-weight but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"layers/#heatmap-color","title":"heatmap-color","text":"

Paint property. Optional color. Defaults to interpolate,linear,heatmap-density,0,rgba(0, 0, 255, 0),0.1,royalblue,0.3,cyan,0.5,lime,0.7,yellow,1,red. Supports interpolate expressions.

Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses [\"heatmap-density\"] as input.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0 data-driven styling Not supported yet Not supported yet Not supported yet"},{"location":"layers/#heatmap-opacity","title":"heatmap-opacity","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Supports interpolate expressions. Transitionable.

The global opacity at which the heatmap layer will be drawn.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.41.0 6.0.0 4.0.0"},{"location":"layers/#fill-extrusion","title":"Fill-extrusion","text":""},{"location":"layers/#visibility_4","title":"visibility","text":"

Layout property. Optional enum. Possible values: visible, none. Defaults to visible.

Whether this layer is displayed.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0"},{"location":"layers/#fill-extrusion-opacity","title":"fill-extrusion-opacity","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Supports interpolate expressions. Transitionable.

The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0"},{"location":"layers/#fill-extrusion-color","title":"fill-extrusion-color","text":"

Paint property. Optional color. Defaults to #000000. Disabled by fill-extrusion-pattern. Supports feature-state and interpolate expressions. Transitionable.

The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root light settings. If this color is specified as rgba with an alpha component, the alpha component will be ignored; use fill-extrusion-opacity to set layer opacity.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0 data-driven styling 0.27.0 5.1.0 3.6.0"},{"location":"layers/#fill-extrusion-translate","title":"fill-extrusion-translate","text":"

Paint property. Optional array. Units in pixels. Defaults to 0,0. Supports interpolate expressions. Transitionable.

The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0"},{"location":"layers/#fill-extrusion-translate-anchor","title":"fill-extrusion-translate-anchor","text":"

Paint property. Optional enum. Possible values: map, viewport. Defaults to map. Requires fill-extrusion-translate.

Controls the frame of reference for fill-extrusion-translate.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0"},{"location":"layers/#fill-extrusion-pattern","title":"fill-extrusion-pattern","text":"

Paint property. Optional resolvedImage. Transitionable.

Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0 data-driven styling 0.49.0 6.5.0 4.4.0"},{"location":"layers/#fill-extrusion-height","title":"fill-extrusion-height","text":"

Paint property. Optional number in range [0, \u221e). Units in meters. Defaults to 0. Supports feature-state and interpolate expressions. Transitionable.

The height with which to extrude this layer.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0 data-driven styling 0.27.0 5.1.0 3.6.0"},{"location":"layers/#fill-extrusion-base","title":"fill-extrusion-base","text":"

Paint property. Optional number in range [0, \u221e). Units in meters. Defaults to 0. Requires fill-extrusion-height. Supports feature-state and interpolate expressions. Transitionable.

The height with which to extrude the base of this layer. Must be less than or equal to fill-extrusion-height.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0 data-driven styling 0.27.0 5.1.0 3.6.0"},{"location":"layers/#fill-extrusion-vertical-gradient","title":"fill-extrusion-vertical-gradient","text":"

Paint property. Optional boolean. Defaults to true.

Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.50.0 7.0.0 4.7.0"},{"location":"layers/#line","title":"Line","text":""},{"location":"layers/#line-cap","title":"line-cap","text":"

Layout property. Optional enum. Possible values: butt, round, square. Defaults to butt.

The display of line endings.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#line-join","title":"line-join","text":"

Layout property. Optional enum. Possible values: bevel, round, miter. Defaults to miter.

The display of lines when joining.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.40.0 5.2.0 3.7.0"},{"location":"layers/#line-miter-limit","title":"line-miter-limit","text":"

Layout property. Optional number. Defaults to 2. Requires line-join to be miter. Supports interpolate expressions.

Used to automatically convert miter joins to bevel joins for sharp angles.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#line-round-limit","title":"line-round-limit","text":"

Layout property. Optional number. Defaults to 1.05. Requires line-join to be round. Supports interpolate expressions.

Used to automatically convert round joins to miter joins for shallow angles.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#line-sort-key","title":"line-sort-key","text":"

Layout property. Optional number.

Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 1.2.0 9.1.0 5.8.0 data-driven styling 1.2.0 9.1.0 5.8.0"},{"location":"layers/#visibility_5","title":"visibility","text":"

Layout property. Optional enum. Possible values: visible, none. Defaults to visible.

Whether this layer is displayed.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#line-opacity","title":"line-opacity","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Supports feature-state and interpolate expressions. Transitionable.

The opacity at which the line will be drawn.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.29.0 5.0.0 3.5.0"},{"location":"layers/#line-color","title":"line-color","text":"

Paint property. Optional color. Defaults to #000000. Disabled by line-pattern. Supports feature-state and interpolate expressions. Transitionable.

The color with which the line will be drawn.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.23.0 5.0.0 3.5.0"},{"location":"layers/#line-translate","title":"line-translate","text":"

Paint property. Optional array. Units in pixels. Defaults to 0,0. Supports interpolate expressions. Transitionable.

The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#line-translate-anchor","title":"line-translate-anchor","text":"

Paint property. Optional enum. Possible values: map, viewport. Defaults to map. Requires line-translate.

Controls the frame of reference for line-translate.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#line-width","title":"line-width","text":"

Paint property. Optional number in range [0, \u221e). Units in pixels. Defaults to 1. Supports feature-state and interpolate expressions. Transitionable.

Stroke thickness.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.39.0 5.2.0 3.7.0"},{"location":"layers/#line-gap-width","title":"line-gap-width","text":"

Paint property. Optional number in range [0, \u221e). Units in pixels. Defaults to 0. Supports feature-state and interpolate expressions. Transitionable.

Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.29.0 5.0.0 3.5.0"},{"location":"layers/#line-offset","title":"line-offset","text":"

Paint property. Optional number. Units in pixels. Defaults to 0. Supports feature-state and interpolate expressions. Transitionable.

The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.12.1 3.0.0 3.1.0 data-driven styling 0.29.0 5.0.0 3.5.0"},{"location":"layers/#line-blur","title":"line-blur","text":"

Paint property. Optional number in range [0, \u221e). Units in pixels. Defaults to 0. Supports feature-state and interpolate expressions. Transitionable.

Blur applied to the line, in pixels.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.29.0 5.0.0 3.5.0"},{"location":"layers/#line-dasharray","title":"line-dasharray","text":"

Paint property. Optional array in range [0, \u221e). Units in line widths. Disabled by line-pattern. Transitionable.

Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with lineMetrics: true specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling \u274c (#1235) \u274c (#744) \u274c (#744)"},{"location":"layers/#line-pattern","title":"line-pattern","text":"

Paint property. Optional resolvedImage. Transitionable.

Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.49.0 6.5.0 4.4.0"},{"location":"layers/#line-gradient","title":"line-gradient","text":"

Paint property. Optional color. Disabled by line-dasharray. Disabled by line-pattern. Requires source to be geojson. Supports interpolate expressions.

Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify \"lineMetrics\": true.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.45.0 6.5.0 4.4.0 data-driven styling Not supported yet Not supported yet Not supported yet"},{"location":"layers/#symbol","title":"Symbol","text":""},{"location":"layers/#symbol-placement","title":"symbol-placement","text":"

Layout property. Optional enum. Possible values: point, line, line-center. Defaults to point.

Label placement relative to its geometry.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 line-center value 0.47.0 6.4.0 4.3.0"},{"location":"layers/#symbol-spacing","title":"symbol-spacing","text":"

Layout property. Optional number in range [1, \u221e). Units in pixels. Defaults to 250. Requires symbol-placement to be line. Supports interpolate expressions.

Distance between two symbol anchors.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#symbol-avoid-edges","title":"symbol-avoid-edges","text":"

Layout property. Optional boolean. Defaults to false.

If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like MapLibre GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#symbol-sort-key","title":"symbol-sort-key","text":"

Layout property. Optional number.

Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When icon-allow-overlap or text-allow-overlap is false, features with a lower sort key will have priority during placement. When icon-allow-overlap or text-allow-overlap is set to true, features with a higher sort key will overlap over features with a lower sort key.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.53.0 7.4.0 4.11.0 data-driven styling 0.53.0 7.4.0 4.11.0"},{"location":"layers/#symbol-z-order","title":"symbol-z-order","text":"

Layout property. Optional enum. Possible values: auto, viewport-y, source. Defaults to auto.

Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use symbol-sort-key.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.49.0 6.6.0 4.5.0"},{"location":"layers/#icon-allow-overlap","title":"icon-allow-overlap","text":"

Layout property. Optional boolean. Defaults to false. Requires icon-image. Disabled by icon-overlap.

If true, the icon will be visible even if it collides with other previously drawn symbols.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#icon-overlap","title":"icon-overlap","text":"

Layout property. Optional enum. Possible values: never, always, cooperative. Requires icon-image.

Allows for control over whether to show an icon when it overlaps other symbols on the map. If icon-overlap is not set, icon-allow-overlap is used instead.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 2.1.0 \u274c (#251) \u274c (#251)"},{"location":"layers/#icon-ignore-placement","title":"icon-ignore-placement","text":"

Layout property. Optional boolean. Defaults to false. Requires icon-image.

If true, other symbols can be visible even if they collide with the icon.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#icon-optional","title":"icon-optional","text":"

Layout property. Optional boolean. Defaults to false. Requires icon-image. Requires text-field.

If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#icon-rotation-alignment","title":"icon-rotation-alignment","text":"

Layout property. Optional enum. Possible values: map, viewport, auto. Defaults to auto. Requires icon-image.

In combination with symbol-placement, determines the rotation behavior of icons.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 auto value 0.25.0 4.2.0 3.4.0"},{"location":"layers/#icon-size","title":"icon-size","text":"

Layout property. Optional number in range [0, \u221e). Units in factor of the original icon size. Defaults to 1. Requires icon-image. Supports interpolate expressions.

Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by icon-size. 1 is the original size; 3 triples the size of the image.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.35.0 5.1.0 3.6.0"},{"location":"layers/#icon-text-fit","title":"icon-text-fit","text":"

Layout property. Optional enum. Possible values: none, width, height, both. Defaults to none. Requires icon-image. Requires text-field.

Scales the icon to fit around the associated text.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.21.0 4.2.0 3.4.0 stretchable icons 1.6.0 9.2.0 5.8.0"},{"location":"layers/#icon-text-fit-padding","title":"icon-text-fit-padding","text":"

Layout property. Optional array. Units in pixels. Defaults to 0,0,0,0. Requires icon-image. Requires text-field. Requires icon-text-fit to be one of both, width, height. Supports interpolate expressions.

Size of the additional area added to dimensions determined by icon-text-fit, in clockwise order: top, right, bottom, left.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.21.0 4.2.0 3.4.0"},{"location":"layers/#icon-image","title":"icon-image","text":"

Layout property. Optional resolvedImage.

Name of image in sprite to use for drawing an image background.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.35.0 5.1.0 3.6.0"},{"location":"layers/#icon-rotate","title":"icon-rotate","text":"

Layout property. Optional number. Units in degrees. Defaults to 0. Requires icon-image. Supports interpolate expressions.

Rotates the icon clockwise.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.21.0 5.0.0 3.5.0"},{"location":"layers/#icon-padding","title":"icon-padding","text":"

Layout property. Optional padding. Units in pixels. Defaults to 2. Requires icon-image. Supports interpolate expressions.

Size of additional area round the icon bounding box used for detecting symbol collisions.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 2.2.0 \u274c (#2754) \u274c (#2754)"},{"location":"layers/#icon-keep-upright","title":"icon-keep-upright","text":"

Layout property. Optional boolean. Defaults to false. Requires icon-image. Requires icon-rotation-alignment to be map. Requires symbol-placement to be one of line, line-center.

If true, the icon may be flipped to prevent it from being rendered upside-down.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#icon-offset","title":"icon-offset","text":"

Layout property. Optional array. Defaults to 0,0. Requires icon-image. Supports interpolate expressions.

Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of icon-size to obtain the final offset in pixels. When combined with icon-rotate the offset will be as if the rotated direction was up.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.29.0 5.0.0 3.5.0"},{"location":"layers/#icon-anchor","title":"icon-anchor","text":"

Layout property. Optional enum. Possible values: center, left, right, top, bottom, top-left, top-right, bottom-left, bottom-right. Defaults to center. Requires icon-image.

Part of the icon placed closest to the anchor.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.40.0 5.2.0 3.7.0 data-driven styling 0.40.0 5.2.0 3.7.0"},{"location":"layers/#icon-pitch-alignment","title":"icon-pitch-alignment","text":"

Layout property. Optional enum. Possible values: map, viewport, auto. Defaults to auto. Requires icon-image.

Orientation of icon when map is pitched.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.39.0 5.2.0 3.7.0"},{"location":"layers/#text-pitch-alignment","title":"text-pitch-alignment","text":"

Layout property. Optional enum. Possible values: map, viewport, auto. Defaults to auto. Requires text-field.

Orientation of text when map is pitched.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.21.0 4.2.0 3.4.0 auto value 0.25.0 4.2.0 3.4.0"},{"location":"layers/#text-rotation-alignment","title":"text-rotation-alignment","text":"

Layout property. Optional enum. Possible values: map, viewport, viewport-glyph, auto. Defaults to auto. Requires text-field.

In combination with symbol-placement, determines the rotation behavior of the individual glyphs forming the text.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 auto value 0.25.0 4.2.0 3.4.0 viewport-glyph value 2.1.8 \u274c (#250) \u274c (#250)"},{"location":"layers/#text-field","title":"text-field","text":"

Layout property. Optional formatted. Defaults to ``.

Value to use for a text label. If a plain string is provided, it will be treated as a formatted with default/inherited formatting options.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#text-font","title":"text-font","text":"

Layout property. Optional array. Defaults to Open Sans Regular,Arial Unicode MS Regular. Requires text-field.

Font stack to use for displaying text.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.43.0 6.0.0 4.0.0"},{"location":"layers/#text-size","title":"text-size","text":"

Layout property. Optional number in range [0, \u221e). Units in pixels. Defaults to 16. Requires text-field. Supports interpolate expressions.

Font size.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.35.0 5.1.0 3.6.0"},{"location":"layers/#text-max-width","title":"text-max-width","text":"

Layout property. Optional number in range [0, \u221e). Units in ems. Defaults to 10. Requires text-field. Supports interpolate expressions.

The maximum line width for text wrapping.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.40.0 5.2.0 3.7.0"},{"location":"layers/#text-line-height","title":"text-line-height","text":"

Layout property. Optional number. Units in ems. Defaults to 1.2. Requires text-field. Supports interpolate expressions.

Text leading value for multi-line text.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#text-letter-spacing","title":"text-letter-spacing","text":"

Layout property. Optional number. Units in ems. Defaults to 0. Requires text-field. Supports interpolate expressions.

Text tracking amount.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.40.0 5.2.0 3.7.0"},{"location":"layers/#text-justify","title":"text-justify","text":"

Layout property. Optional enum. Possible values: auto, left, center, right. Defaults to center. Requires text-field.

Text justification options.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.39.0 5.2.0 3.7.0 auto 0.54.0 7.4.0 4.10.0"},{"location":"layers/#text-radial-offset","title":"text-radial-offset","text":"

Layout property. Optional number. Units in ems. Defaults to 0. Requires text-field. Supports interpolate expressions.

Radial offset of text, in the direction of the symbol's anchor. Useful in combination with text-variable-anchor, which defaults to using the two-dimensional text-offset if present.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.54.0 7.4.0 4.10.0 data-driven styling 0.54.0 7.4.0 4.10.0"},{"location":"layers/#text-variable-anchor","title":"text-variable-anchor","text":"

Layout property. Optional array. Requires text-field. Requires symbol-placement to be point.

To increase the chance of placing high-priority labels on the map, you can provide an array of text-anchor locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use text-justify: auto to choose justification based on anchor position. To apply an offset, use the text-radial-offset or the two-dimensional text-offset.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.54.0 7.4.0 4.10.0"},{"location":"layers/#text-variable-anchor-offset","title":"text-variable-anchor-offset","text":"

Layout property. Optional. Requires text-field. Requires symbol-placement to be point. Supports interpolate expressions.

To increase the chance of placing high-priority labels on the map, you can provide an array of text-anchor locations, each paired with an offset value. The renderer will attempt to place the label at each location, in order, before moving on to the next location+offset. Use text-justify: auto to choose justification based on anchor position.

The length of the array must be even, and must alternate between enum and point entries. i.e., each anchor location must be accompanied by a point, and that point defines the offset when the corresponding anchor location is used. Positive offset values indicate right and down, while negative values indicate left and up. Anchor locations may repeat, allowing the renderer to try multiple offsets to try and place a label using the same anchor.

When present, this property takes precedence over text-anchor, text-variable-anchor, text-offset, and text-radial-offset.

{ \"text-variable-anchor-offset\": [\"top\", [0, 4], \"left\", [3,0], \"bottom\", [1, 1]] } \n

When the renderer chooses the top anchor, [0, 4] will be used for text-offset; the text will be shifted down by 4 ems.

When the renderer chooses the left anchor, [3, 0] will be used for text-offset; the text will be shifted right by 3 ems.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 3.3.0 \u274c (#2358) \u274c (#2358) data-driven styling 3.3.0 \u274c (#2358) \u274c (#2358)"},{"location":"layers/#text-anchor","title":"text-anchor","text":"

Layout property. Optional enum. Possible values: center, left, right, top, bottom, top-left, top-right, bottom-left, bottom-right. Defaults to center. Requires text-field. Disabled by text-variable-anchor.

Part of the text placed closest to the anchor.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.39.0 5.2.0 3.7.0"},{"location":"layers/#text-max-angle","title":"text-max-angle","text":"

Layout property. Optional number. Units in degrees. Defaults to 45. Requires text-field. Requires symbol-placement to be one of line, line-center. Supports interpolate expressions.

Maximum angle change between adjacent characters.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#text-writing-mode","title":"text-writing-mode","text":"

Layout property. Optional array. Requires text-field. Requires symbol-placement to be point.

The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn\u2019t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 1.3.0 8.3.0 5.3.0"},{"location":"layers/#text-rotate","title":"text-rotate","text":"

Layout property. Optional number. Units in degrees. Defaults to 0. Requires text-field. Supports interpolate expressions.

Rotates the text clockwise.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.35.0 5.1.0 3.6.0"},{"location":"layers/#text-padding","title":"text-padding","text":"

Layout property. Optional number in range [0, \u221e). Units in pixels. Defaults to 2. Requires text-field. Supports interpolate expressions.

Size of the additional area around the text bounding box used for detecting symbol collisions.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#text-keep-upright","title":"text-keep-upright","text":"

Layout property. Optional boolean. Defaults to true. Requires text-field. Requires text-rotation-alignment to be map. Requires symbol-placement to be one of line, line-center.

If true, the text may be flipped vertically to prevent it from being rendered upside-down.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#text-transform","title":"text-transform","text":"

Layout property. Optional enum. Possible values: none, uppercase, lowercase. Defaults to none. Requires text-field.

Specifies how to capitalize text, similar to the CSS text-transform property.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#text-offset","title":"text-offset","text":"

Layout property. Optional array. Units in ems. Defaults to 0,0. Requires text-field. Disabled by text-radial-offset. Supports interpolate expressions.

Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.35.0 5.1.0 3.6.0"},{"location":"layers/#text-allow-overlap","title":"text-allow-overlap","text":"

Layout property. Optional boolean. Defaults to false. Requires text-field. Disabled by text-overlap.

If true, the text will be visible even if it collides with other previously drawn symbols.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#text-overlap","title":"text-overlap","text":"

Layout property. Optional enum. Possible values: never, always, cooperative. Requires text-field.

Allows for control over whether to show symbol text when it overlaps other symbols on the map. If text-overlap is not set, text-allow-overlap is used instead

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 2.1.0 \u274c (#251) \u274c (#251)"},{"location":"layers/#text-ignore-placement","title":"text-ignore-placement","text":"

Layout property. Optional boolean. Defaults to false. Requires text-field.

If true, other symbols can be visible even if they collide with the text.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#text-optional","title":"text-optional","text":"

Layout property. Optional boolean. Defaults to false. Requires text-field. Requires icon-image.

If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#visibility_6","title":"visibility","text":"

Layout property. Optional enum. Possible values: visible, none. Defaults to visible.

Whether this layer is displayed.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#icon-opacity","title":"icon-opacity","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Requires icon-image. Supports feature-state and interpolate expressions. Transitionable.

The opacity at which the icon will be drawn.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#icon-color","title":"icon-color","text":"

Paint property. Optional color. Defaults to #000000. Requires icon-image. Supports feature-state and interpolate expressions. Transitionable.

The color of the icon. This can only be used with SDF icons.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#icon-halo-color","title":"icon-halo-color","text":"

Paint property. Optional color. Defaults to rgba(0, 0, 0, 0). Requires icon-image. Supports feature-state and interpolate expressions. Transitionable.

The color of the icon's halo. Icon halos can only be used with SDF icons.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#icon-halo-width","title":"icon-halo-width","text":"

Paint property. Optional number in range [0, \u221e). Units in pixels. Defaults to 0. Requires icon-image. Supports feature-state and interpolate expressions. Transitionable.

Distance of halo to the icon outline.

The unit is in pixels only for SDF sprites that were created with a blur radius of 8, multiplied by the display density. I.e., the radius needs to be 16 for @2x sprites, etc.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#icon-halo-blur","title":"icon-halo-blur","text":"

Paint property. Optional number in range [0, \u221e). Units in pixels. Defaults to 0. Requires icon-image. Supports feature-state and interpolate expressions. Transitionable.

Fade out the halo towards the outside.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#icon-translate","title":"icon-translate","text":"

Paint property. Optional array. Units in pixels. Defaults to 0,0. Requires icon-image. Supports interpolate expressions. Transitionable.

Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#icon-translate-anchor","title":"icon-translate-anchor","text":"

Paint property. Optional enum. Possible values: map, viewport. Defaults to map. Requires icon-image. Requires icon-translate.

Controls the frame of reference for icon-translate.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#text-opacity","title":"text-opacity","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Requires text-field. Supports feature-state and interpolate expressions. Transitionable.

The opacity at which the text will be drawn.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#text-color","title":"text-color","text":"

Paint property. Optional color. Defaults to #000000. Requires text-field. Supports feature-state and interpolate expressions. Transitionable.

The color with which the text will be drawn.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#text-halo-color","title":"text-halo-color","text":"

Paint property. Optional color. Defaults to rgba(0, 0, 0, 0). Requires text-field. Supports feature-state and interpolate expressions. Transitionable.

The color of the text's halo, which helps it stand out from backgrounds.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#text-halo-width","title":"text-halo-width","text":"

Paint property. Optional number in range [0, \u221e). Units in pixels. Defaults to 0. Requires text-field. Supports feature-state and interpolate expressions. Transitionable.

Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#text-halo-blur","title":"text-halo-blur","text":"

Paint property. Optional number in range [0, \u221e). Units in pixels. Defaults to 0. Requires text-field. Supports feature-state and interpolate expressions. Transitionable.

The halo's fadeout distance towards the outside.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 data-driven styling 0.33.0 5.0.0 3.5.0"},{"location":"layers/#text-translate","title":"text-translate","text":"

Paint property. Optional array. Units in pixels. Defaults to 0,0. Requires text-field. Supports interpolate expressions. Transitionable.

Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#text-translate-anchor","title":"text-translate-anchor","text":"

Paint property. Optional enum. Possible values: map, viewport. Defaults to map. Requires text-field. Requires text-translate.

Controls the frame of reference for text-translate.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#raster","title":"Raster","text":""},{"location":"layers/#visibility_7","title":"visibility","text":"

Layout property. Optional enum. Possible values: visible, none. Defaults to visible.

Whether this layer is displayed.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#raster-opacity","title":"raster-opacity","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Supports interpolate expressions. Transitionable.

The opacity at which the image will be drawn.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#raster-hue-rotate","title":"raster-hue-rotate","text":"

Paint property. Optional number. Units in degrees. Defaults to 0. Supports interpolate expressions. Transitionable.

Rotates hues around the color wheel.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#raster-brightness-min","title":"raster-brightness-min","text":"

Paint property. Optional number in range [0, 1]. Defaults to 0. Supports interpolate expressions. Transitionable.

Increase or reduce the brightness of the image. The value is the minimum brightness.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#raster-brightness-max","title":"raster-brightness-max","text":"

Paint property. Optional number in range [0, 1]. Defaults to 1. Supports interpolate expressions. Transitionable.

Increase or reduce the brightness of the image. The value is the maximum brightness.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#raster-saturation","title":"raster-saturation","text":"

Paint property. Optional number in range [-1, 1]. Defaults to 0. Supports interpolate expressions. Transitionable.

Increase or reduce the saturation of the image.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#raster-contrast","title":"raster-contrast","text":"

Paint property. Optional number in range [-1, 1]. Defaults to 0. Supports interpolate expressions. Transitionable.

Increase or reduce the contrast of the image.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#raster-resampling","title":"raster-resampling","text":"

Paint property. Optional enum. Possible values: linear, nearest. Defaults to linear.

The resampling/interpolation method to use for overscaling, also known as texture magnification filter

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.47.0 6.3.0 4.2.0"},{"location":"layers/#raster-fade-duration","title":"raster-fade-duration","text":"

Paint property. Optional number in range [0, \u221e). Units in milliseconds. Defaults to 300. Supports interpolate expressions.

Fade duration when a new tile is added, or when a video is started or its coordinates are updated.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"layers/#hillshade","title":"Hillshade","text":""},{"location":"layers/#visibility_8","title":"visibility","text":"

Layout property. Optional enum. Possible values: visible, none. Defaults to visible.

Whether this layer is displayed.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.43.0 6.0.0 4.0.0"},{"location":"layers/#hillshade-illumination-direction","title":"hillshade-illumination-direction","text":"

Paint property. Optional number in range [0, 359]. Defaults to 335. Supports interpolate expressions.

The direction of the light source used to generate the hillshading with 0 as the top of the viewport if hillshade-illumination-anchor is set to viewport and due north if hillshade-illumination-anchor is set to map.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.43.0 6.0.0 4.0.0"},{"location":"layers/#hillshade-illumination-anchor","title":"hillshade-illumination-anchor","text":"

Paint property. Optional enum. Possible values: map, viewport. Defaults to viewport.

Direction of light source when map is rotated.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.43.0 6.0.0 4.0.0"},{"location":"layers/#hillshade-exaggeration","title":"hillshade-exaggeration","text":"

Paint property. Optional number in range [0, 1]. Defaults to 0.5. Supports interpolate expressions. Transitionable.

Intensity of the hillshade

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.43.0 6.0.0 4.0.0"},{"location":"layers/#hillshade-shadow-color","title":"hillshade-shadow-color","text":"

Paint property. Optional color. Defaults to #000000. Supports interpolate expressions. Transitionable.

The shading color of areas that face away from the light source.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.43.0 6.0.0 4.0.0"},{"location":"layers/#hillshade-highlight-color","title":"hillshade-highlight-color","text":"

Paint property. Optional color. Defaults to #FFFFFF. Supports interpolate expressions. Transitionable.

The shading color of areas that faces towards the light source.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.43.0 6.0.0 4.0.0"},{"location":"layers/#hillshade-accent-color","title":"hillshade-accent-color","text":"

Paint property. Optional color. Defaults to #000000. Supports interpolate expressions. Transitionable.

The shading color used to accentuate rugged terrain like sharp cliffs and gorges.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.43.0 6.0.0 4.0.0"},{"location":"light/","title":"Light","text":"

The global light source.

light: {\"anchor\": \"viewport\", \"color\": \"white\", \"intensity\": 0.4}\n
"},{"location":"light/#anchor","title":"anchor","text":"

Optional enum. Possible values: map, viewport. Defaults to viewport.

Whether extruded geometries are lit relative to the map or viewport.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0"},{"location":"light/#position","title":"position","text":"

Optional array. Defaults to 1.15,210,30. Supports interpolate expressions. Transitionable.

Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0\u00b0 (0\u00b0 when light.anchor is set to viewport corresponds to the top of the viewport, or 0\u00b0 when light.anchor is set to map corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0\u00b0, directly above, to 180\u00b0, directly below).

position: [1.5, 90, 80]\n
SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0"},{"location":"light/#color","title":"color","text":"

Optional color. Defaults to #ffffff. Supports interpolate expressions. Transitionable.

Color tint for lighting extruded geometries.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0"},{"location":"light/#intensity","title":"intensity","text":"

Optional number in range [0, 1]. Defaults to 0.5. Supports interpolate expressions. Transitionable.

Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.27.0 5.1.0 3.6.0"},{"location":"projection/","title":"Projection","text":"

The projection configuration. Note: this definition is still experimental and is under development in maplibre-gl-js.

projection: {\"type\": \"globe\"}\n
"},{"location":"projection/#type","title":"type","text":"

Optional enum. Possible values: mercator, globe. Defaults to mercator.

The projection type.

"},{"location":"root/","title":"Root","text":"

Root level properties of a MapLibre style specify the map's layers, tile sources and other resources, and default values for the initial camera position when not specified elsewhere.

{\n    \"version\": 8,\n    \"name\": \"MapLibre Demo Tiles\",\n    \"sprite\": \"https://demotiles.maplibre.org/styles/osm-bright-gl-style/sprite\",\n    \"glyphs\": \"https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf\",\n    \"sources\": {... },\n    \"layers\": [...]\n}\n
"},{"location":"root/#version","title":"version","text":"

Required enum.

Style specification version number. Must be 8.

version: 8\n
"},{"location":"root/#name","title":"name","text":"

Optional string.

A human-readable name for the style.

name: \"Bright\"\n
"},{"location":"root/#metadata","title":"metadata","text":"

Optional.

Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'maplibre:'.

metadata: {\n    \"styleeditor:slimmode\": true,\n    \"styleeditor:comment\": \"Style generated 1677776383\",\n    \"styleeditor:version\": \"3.14.159265\",\n    \"example:object\": {\n        \"String\": \"one\",\n        \"Number\": 2,\n        \"Boolean\": false\n    }\n}\n
"},{"location":"root/#center","title":"center","text":"

Optional array.

Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).

center: [-73.9749, 40.7736]\n
"},{"location":"root/#zoom","title":"zoom","text":"

Optional number.

Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).

zoom: 12.5\n
"},{"location":"root/#bearing","title":"bearing","text":"

Optional number. Units in degrees. Defaults to 0.

Default bearing, in degrees. The bearing is the compass direction that is \"up\"; for example, a bearing of 90\u00b0 orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).

bearing: 29\n
"},{"location":"root/#pitch","title":"pitch","text":"

Optional number. Units in degrees. Defaults to 0.

Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).

pitch: 50\n
"},{"location":"root/#light","title":"light","text":"

Optional light.

The global light source.

light: {\"anchor\": \"viewport\", \"color\": \"white\", \"intensity\": 0.4}\n
"},{"location":"root/#sky","title":"sky","text":"

Optional sky.

The map's sky configuration. Note: this definition is still experimental and is under development in maplibre-gl-js.

sky: {\n    \"sky-color\": \"#199EF3\",\n    \"sky-horizon-blend\": 0.5,\n    \"horizon-color\": \"#ffffff\",\n    \"horizon-fog-blend\": 0.5,\n    \"fog-color\": \"#0000ff\",\n    \"fog-ground-blend\": 0.5,\n    \"atmosphere-blend\": [\n        \"interpolate\",\n        [\"linear\"],\n        [\"zoom\"],\n        0,\n        1,\n        10,\n        1,\n        12,\n        0\n    ]\n}\n
"},{"location":"root/#projection","title":"projection","text":"

Optional projection.

The projection configuration. Note: this definition is still experimental and is under development in maplibre-gl-js.

projection: {\"type\": \"globe\"}\n
"},{"location":"root/#terrain","title":"terrain","text":"

Optional terrain.

The terrain configuration.

terrain: {\"source\": \"raster-dem-source\", \"exaggeration\": 0.5}\n
"},{"location":"root/#sources","title":"sources","text":"

Required sources.

Sources state which data the map should display. Specify the type of source with the type property. Adding a source isn't enough to make data appear on the map because sources don't contain styling details like color or width. Layers refer to a source and give it a visual representation. This makes it possible to style the same source in different ways, like differentiating between types of roads in a highways layer.

Tiled sources (vector and raster) must specify their details according to the TileJSON specification.

sources: {\n    \"maplibre-demotiles\": {\n        \"type\": \"vector\",\n        \"url\": \"https://demotiles.maplibre.org/tiles/tiles.json\"\n    },\n    \"maplibre-tilejson\": {\n        \"type\": \"vector\",\n        \"url\": \"http://api.example.com/tilejson.json\"\n    },\n    \"maplibre-streets\": {\n        \"type\": \"vector\",\n        \"tiles\": [\n            \"http://a.example.com/tiles/{z}/{x}/{y}.pbf\",\n            \"http://b.example.com/tiles/{z}/{x}/{y}.pbf\"\n        ],\n        \"maxzoom\": 14\n    },\n    \"wms-imagery\": {\n        \"type\": \"raster\",\n        \"tiles\": [\n            \"http://a.example.com/wms?bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:3857&width=256&height=256&layers=example\"\n        ],\n        \"tileSize\": 256\n    }\n}\n
"},{"location":"root/#sprite","title":"sprite","text":"

Optional sprite.

An array of {id: 'my-sprite', url: 'https://example.com/sprite'} objects. Each object should represent a unique URL to load a sprite from and and a unique ID to use as a prefix when referencing images from that sprite (i.e. 'my-sprite:image'). All the URLs are internally extended to load both .json and .png files. If the id field is equal to 'default', the prefix is omitted (just 'image' instead of 'default:image'). All the IDs and URLs must be unique. For backwards compatibility, instead of an array, one can also provide a single string that represent a URL to load the sprite from. The images in this case won't be prefixed.

sprite: \"https://demotiles.maplibre.org/styles/osm-bright-gl-style/sprite\"\n
"},{"location":"root/#glyphs","title":"glyphs","text":"

Optional string.

A URL template for loading signed-distance-field glyph sets in PBF format.

The URL must include:

This property is required if any layer uses the text-field layout property. The URL must be absolute, containing the scheme, authority and path components.

glyphs: \"https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf\"\n
"},{"location":"root/#transition","title":"transition","text":"

Optional transition.

A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's transition property.

transition: {\"duration\": 300, \"delay\": 0}\n
"},{"location":"root/#layers","title":"layers","text":"

Required array.

A style's layers property lists all the layers available in that style. The type of layer is specified by the type property, and must be one of background, fill, line, symbol, raster, circle, fill-extrusion, heatmap, hillshade.

Except for layers of the background type, each layer needs to refer to a source. Layers take the data that they get from a source, optionally filter features, and then define how those features are styled.

layers: [\n    {\n        \"id\": \"coastline\",\n        \"source\": \"maplibre\",\n        \"source-layer\": \"contries\",\n        \"type\": \"line\",\n        \"paint\": {\"line-color\": \"#198EC8\"}\n    }\n]\n
"},{"location":"sky/","title":"Sky","text":"

The map's sky configuration. Note: this definition is still experimental and is under development in maplibre-gl-js.

sky: {\n    \"sky-color\": \"#199EF3\",\n    \"sky-horizon-blend\": 0.5,\n    \"horizon-color\": \"#ffffff\",\n    \"horizon-fog-blend\": 0.5,\n    \"fog-color\": \"#0000ff\",\n    \"fog-ground-blend\": 0.5,\n    \"atmosphere-blend\": [\n        \"interpolate\",\n        [\"linear\"],\n        [\"zoom\"],\n        0,\n        1,\n        10,\n        1,\n        12,\n        0\n    ]\n}\n
"},{"location":"sky/#sky-color","title":"sky-color","text":"

Optional color. Defaults to #88C6FC. Supports interpolate expressions. Transitionable.

The base color for the sky.

"},{"location":"sky/#horizon-color","title":"horizon-color","text":"

Optional color. Defaults to #ffffff. Supports interpolate expressions. Transitionable.

The base color at the horizon.

"},{"location":"sky/#fog-color","title":"fog-color","text":"

Optional color. Defaults to #ffffff. Supports interpolate expressions. Transitionable.

The base color for the fog. Requires 3D terrain.

"},{"location":"sky/#fog-ground-blend","title":"fog-ground-blend","text":"

Optional number in range [0, 1]. Defaults to 0.5. Supports interpolate expressions. Transitionable.

How to blend the fog over the 3D terrain. Where 0 is the map center and 1 is the horizon.

"},{"location":"sky/#horizon-fog-blend","title":"horizon-fog-blend","text":"

Optional number in range [0, 1]. Defaults to 0.8. Supports interpolate expressions. Transitionable.

How to blend the fog color and the horizon color. Where 0 is using the horizon color only and 1 is using the fog color only.

"},{"location":"sky/#sky-horizon-blend","title":"sky-horizon-blend","text":"

Optional number in range [0, 1]. Defaults to 0.8. Supports interpolate expressions. Transitionable.

How to blend the the sky color and the horizon color. Where 1 is blending the color at the middle of the sky and 0 is not blending at all and using the sky color only.

"},{"location":"sky/#atmosphere-blend","title":"atmosphere-blend","text":"

Optional number in range [0, 1]. Defaults to 0.8. Supports interpolate expressions. Transitionable.

How to blend the atmosphere. Where 1 is visible atmosphere and 0 is hidden. It is best to interpolate this expression when using globe projection.

"},{"location":"sources/","title":"Sources","text":"

Sources state which data the map should display. Specify the type of source with the type property. Adding a source isn't enough to make data appear on the map because sources don't contain styling details like color or width. Layers refer to a source and give it a visual representation. This makes it possible to style the same source in different ways, like differentiating between types of roads in a highways layer.

Tiled sources (vector and raster) must specify their details according to the TileJSON specification.

sources: {\n    \"maplibre-demotiles\": {\n        \"type\": \"vector\",\n        \"url\": \"https://demotiles.maplibre.org/tiles/tiles.json\"\n    },\n    \"maplibre-tilejson\": {\n        \"type\": \"vector\",\n        \"url\": \"http://api.example.com/tilejson.json\"\n    },\n    \"maplibre-streets\": {\n        \"type\": \"vector\",\n        \"tiles\": [\n            \"http://a.example.com/tiles/{z}/{x}/{y}.pbf\",\n            \"http://b.example.com/tiles/{z}/{x}/{y}.pbf\"\n        ],\n        \"maxzoom\": 14\n    },\n    \"wms-imagery\": {\n        \"type\": \"raster\",\n        \"tiles\": [\n            \"http://a.example.com/wms?bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:3857&width=256&height=256&layers=example\"\n        ],\n        \"tileSize\": 256\n    }\n}\n
"},{"location":"sources/#vector","title":"vector","text":"

A vector tile source. Tiles must be in Mapbox Vector Tile format. All geometric coordinates in vector tiles must be between -1 * extent and (extent * 2) - 1 inclusive. All layers that use a vector source must specify a source-layer value.

sources: {\n    \"maplibre-streets\": {\n        \"type\": \"vector\",\n        \"tiles\": [\n            \"http://a.example.com/tiles/{z}/{x}/{y}.pbf\"\n        ]\n    }\n}\n
SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"sources/#type","title":"type","text":"

Required enum. Possible values: vector.

The type of the source.

"},{"location":"sources/#url","title":"url","text":"

Optional string.

A URL to a TileJSON resource. Supported protocols are http: and https:.

"},{"location":"sources/#tiles","title":"tiles","text":"

Optional array.

An array of one or more tile source URLs, as in the TileJSON spec.

"},{"location":"sources/#bounds","title":"bounds","text":"

Optional array. Defaults to -180,-85.051129,180,85.051129.

An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: [sw.lng, sw.lat, ne.lng, ne.lat]. When this property is included in a source, no tiles outside of the given bounds are requested by MapLibre.

"},{"location":"sources/#scheme","title":"scheme","text":"

Optional enum. Possible values: xyz, tms. Defaults to xyz.

Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed.

"},{"location":"sources/#minzoom","title":"minzoom","text":"

Optional number. Defaults to 0.

Minimum zoom level for which tiles are available, as in the TileJSON spec.

"},{"location":"sources/#maxzoom","title":"maxzoom","text":"

Optional number. Defaults to 22.

Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels.

"},{"location":"sources/#attribution","title":"attribution","text":"

Optional string.

Contains an attribution to be displayed when the map is shown to a user.

"},{"location":"sources/#promoteid","title":"promoteId","text":"

Optional promoteId.

A property to use as a feature id (for feature state). Either a property name, or an object of the form {<sourceLayer>: <propertyName>}. If specified as a string for a vector tile source, the same property is used across all its source layers.

"},{"location":"sources/#volatile","title":"volatile","text":"

Optional boolean. Defaults to false.

A setting to determine whether a source's tiles are cached locally.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality Not planned 9.3.0 5.10.0"},{"location":"sources/#raster","title":"raster","text":"

A raster tile source.

sources: {\n    \"maplibre-satellite\": {\n        \"type\": \"raster\",\n        \"tiles\": [\n            \"http://a.example.com/tiles/{z}/{x}/{y}.png\"\n        ],\n        \"tileSize\": 256\n    }\n}\n
SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0"},{"location":"sources/#type_1","title":"type","text":"

Required enum. Possible values: raster.

The type of the source.

"},{"location":"sources/#url_1","title":"url","text":"

Optional string.

A URL to a TileJSON resource. Supported protocols are http: and https:.

"},{"location":"sources/#tiles_1","title":"tiles","text":"

Optional array.

An array of one or more tile source URLs, as in the TileJSON spec.

"},{"location":"sources/#bounds_1","title":"bounds","text":"

Optional array. Defaults to -180,-85.051129,180,85.051129.

An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: [sw.lng, sw.lat, ne.lng, ne.lat]. When this property is included in a source, no tiles outside of the given bounds are requested by MapLibre.

"},{"location":"sources/#minzoom_1","title":"minzoom","text":"

Optional number. Defaults to 0.

Minimum zoom level for which tiles are available, as in the TileJSON spec.

"},{"location":"sources/#maxzoom_1","title":"maxzoom","text":"

Optional number. Defaults to 22.

Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels.

"},{"location":"sources/#tilesize","title":"tileSize","text":"

Optional number. Units in pixels. Defaults to 512.

The minimum visual size to display tiles for this layer. Only configurable for raster layers.

"},{"location":"sources/#scheme_1","title":"scheme","text":"

Optional enum. Possible values: xyz, tms. Defaults to xyz.

Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed.

"},{"location":"sources/#attribution_1","title":"attribution","text":"

Optional string.

Contains an attribution to be displayed when the map is shown to a user.

"},{"location":"sources/#volatile_1","title":"volatile","text":"

Optional boolean. Defaults to false.

A setting to determine whether a source's tiles are cached locally.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality Not planned 9.3.0 5.10.0"},{"location":"sources/#raster-dem","title":"raster-dem","text":"

A raster DEM source. Only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.

sources: {\n    \"maplibre-terrain-rgb\": {\n        \"type\": \"raster-dem\",\n        \"encoding\": \"mapbox\",\n        \"tiles\": [\n            \"http://a.example.com/dem-tiles/{z}/{x}/{y}.png\"\n        ]\n    }\n}\n
SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.43.0 6.0.0 4.0.0"},{"location":"sources/#type_2","title":"type","text":"

Required enum. Possible values: raster-dem.

The type of the source.

"},{"location":"sources/#url_2","title":"url","text":"

Optional string.

A URL to a TileJSON resource. Supported protocols are http: and https:.

"},{"location":"sources/#tiles_2","title":"tiles","text":"

Optional array.

An array of one or more tile source URLs, as in the TileJSON spec.

"},{"location":"sources/#bounds_2","title":"bounds","text":"

Optional array. Defaults to -180,-85.051129,180,85.051129.

An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: [sw.lng, sw.lat, ne.lng, ne.lat]. When this property is included in a source, no tiles outside of the given bounds are requested by MapLibre.

"},{"location":"sources/#minzoom_2","title":"minzoom","text":"

Optional number. Defaults to 0.

Minimum zoom level for which tiles are available, as in the TileJSON spec.

"},{"location":"sources/#maxzoom_2","title":"maxzoom","text":"

Optional number. Defaults to 22.

Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels.

"},{"location":"sources/#tilesize_1","title":"tileSize","text":"

Optional number. Units in pixels. Defaults to 512.

The minimum visual size to display tiles for this layer. Only configurable for raster layers.

"},{"location":"sources/#attribution_2","title":"attribution","text":"

Optional string.

Contains an attribution to be displayed when the map is shown to a user.

"},{"location":"sources/#encoding","title":"encoding","text":"

Optional enum. Possible values: terrarium, mapbox, custom. Defaults to mapbox.

The encoding used by this source. Mapbox Terrain RGB is used by default.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS mapbox, terrarium 0.43.0 6.0.0 6.0.0 custom 3.4.0 \u274c (#2783) \u274c (#2783)"},{"location":"sources/#redfactor","title":"redFactor","text":"

Optional number. Defaults to 1.

Value that will be multiplied by the red channel value when decoding. Only used on custom encodings.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 3.4.0 \u274c (#2783) \u274c (#2783)"},{"location":"sources/#bluefactor","title":"blueFactor","text":"

Optional number. Defaults to 1.

Value that will be multiplied by the blue channel value when decoding. Only used on custom encodings.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 3.4.0 \u274c (#2783) \u274c (#2783)"},{"location":"sources/#greenfactor","title":"greenFactor","text":"

Optional number. Defaults to 1.

Value that will be multiplied by the green channel value when decoding. Only used on custom encodings.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 3.4.0 \u274c (#2783) \u274c (#2358)"},{"location":"sources/#baseshift","title":"baseShift","text":"

Optional number. Defaults to 0.

Value that will be added to the encoding mix when decoding. Only used on custom encodings.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 3.4.0 \u274c (#2783) \u274c (#2783)"},{"location":"sources/#volatile_2","title":"volatile","text":"

Optional boolean. Defaults to false.

A setting to determine whether a source's tiles are cached locally.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality Not planned 9.3.0 5.10.0"},{"location":"sources/#geojson","title":"geojson","text":"

A GeoJSON source. Data must be provided via a \"data\" property, whose value can be a URL or inline GeoJSON. When using in a browser, the GeoJSON data must be on the same domain as the map or served with CORS headers.

sources: {\n    \"geojson-marker\": {\n        \"type\": \"geojson\",\n        \"data\": {\n            \"type\": \"Feature\",\n            \"geometry\": {\n                \"type\": \"Point\",\n                \"coordinates\": [12.550343, 55.665957]\n            },\n            \"properties\": {\n                \"title\": \"Somewhere\",\n                \"marker-symbol\": \"monument\"\n            }\n        }\n    },\n    \"geojson-lines\": {\n        \"type\": \"geojson\",\n        \"data\": \"./lines.geojson\"\n    }\n}\n
SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 2.0.1 2.0.0 clustering 0.14.0 4.2.0 3.4.0 line distance metrics 0.45.0 6.5.0 4.4.0"},{"location":"sources/#type_3","title":"type","text":"

Required enum. Possible values: geojson.

The data type of the GeoJSON source.

"},{"location":"sources/#data","title":"data","text":"

Required.

A URL to a GeoJSON file, or inline GeoJSON.

"},{"location":"sources/#maxzoom_3","title":"maxzoom","text":"

Optional number. Defaults to 18.

Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels).

"},{"location":"sources/#attribution_3","title":"attribution","text":"

Optional string.

Contains an attribution to be displayed when the map is shown to a user.

"},{"location":"sources/#buffer","title":"buffer","text":"

Optional number in range [0, 512]. Defaults to 128.

Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance.

"},{"location":"sources/#filter","title":"filter","text":"

Optional.

An expression for filtering features prior to processing them for rendering.

"},{"location":"sources/#tolerance","title":"tolerance","text":"

Optional number. Defaults to 0.375.

Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance).

"},{"location":"sources/#cluster","title":"cluster","text":"

Optional boolean. Defaults to false.

If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new Point features in the source with additional properties:

"},{"location":"sources/#clusterradius","title":"clusterRadius","text":"

Optional number in range [0, \u221e). Defaults to 50.

Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile.

"},{"location":"sources/#clustermaxzoom","title":"clusterMaxZoom","text":"

Optional number.

Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15.

"},{"location":"sources/#clusterminpoints","title":"clusterMinPoints","text":"

Optional number.

Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to 2.

"},{"location":"sources/#clusterproperties","title":"clusterProperties","text":"

Optional.

An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form {\"property_name\": [operator, map_expression]}. operator is any expression function that accepts at least 2 operands (e.g. \"+\" or \"max\") \u2014 it accumulates the property value from clusters/points the cluster contains; map_expression produces the value of a single point.

Example: {\"sum\": [\"+\", [\"get\", \"scalerank\"]]}.

For more advanced use cases, in place of operator, you can use a custom reduce expression that references a special [\"accumulated\"] value, e.g.:

{\"sum\": [[\"+\", [\"accumulated\"], [\"get\", \"sum\"]], [\"get\", \"scalerank\"]]}

"},{"location":"sources/#linemetrics","title":"lineMetrics","text":"

Optional boolean. Defaults to false.

Whether to calculate line distance metrics. This is required for line layers that specify line-gradient values.

"},{"location":"sources/#generateid","title":"generateId","text":"

Optional boolean. Defaults to false.

Whether to generate ids for the geojson features. When enabled, the feature.id property will be auto assigned based on its index in the features array, over-writing any previous values.

"},{"location":"sources/#promoteid_1","title":"promoteId","text":"

Optional promoteId.

A property to use as a feature id (for feature state). Either a property name, or an object of the form {<sourceLayer>: <propertyName>}.

"},{"location":"sources/#video","title":"video","text":"

A video source. The urls value is an array. For each URL in the array, a video element source will be created. To support the video across browsers, supply URLs in multiple formats.

The coordinates array contains [longitude, latitude] pairs for the video corners listed in clockwise order: top left, top right, bottom right, bottom left.

When rendered as a raster layer, the layer's raster-fade-duration property will cause the video to fade in. This happens when playback is started, paused and resumed, or when the video's coordinates are updated. To avoid this behavior, set the layer's raster-fade-duration property to 0.

sources: {\n    \"video\": {\n        \"type\": \"video\",\n        \"urls\": [\n            \"https://static-assets.mapbox.com/mapbox-gl-js/drone.mp4\",\n            \"https://static-assets.mapbox.com/mapbox-gl-js/drone.webm\"\n        ],\n        \"coordinates\": [\n            [-122.51596391201019, 37.56238816766053],\n            [-122.51467645168304, 37.56410183312965],\n            [-122.51309394836426, 37.563391708549425],\n            [-122.51423120498657, 37.56161849366671]\n        ]\n    }\n}\n
SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 Not supported yet Not supported yet"},{"location":"sources/#type_4","title":"type","text":"

Required enum. Possible values: video.

The data type of the video source.

"},{"location":"sources/#urls","title":"urls","text":"

Required array.

URLs to video content in order of preferred format.

"},{"location":"sources/#coordinates","title":"coordinates","text":"

Required array.

Corners of video specified in longitude, latitude pairs.

"},{"location":"sources/#image","title":"image","text":"

An image source. The url value contains the image location. The coordinates array contains [longitude, latitude] pairs for the image corners listed in clockwise order: top left, top right, bottom right, bottom left.

sources: {\n    \"image\": {\n        \"type\": \"image\",\n        \"url\": \"https://maplibre.org/maplibre-gl-js/docs/assets/radar.gif\",\n        \"coordinates\": [\n            [-80.425, 46.437],\n            [-71.516, 46.437],\n            [-71.516, 37.936],\n            [-80.425, 37.936]\n        ]\n    }\n}\n
SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 0.10.0 5.2.0 3.7.0"},{"location":"sources/#type_5","title":"type","text":"

Required enum. Possible values: image.

The data type of the image source.

"},{"location":"sources/#url_3","title":"url","text":"

Required string.

URL that points to an image.

"},{"location":"sources/#coordinates_1","title":"coordinates","text":"

Required array.

Corners of image specified in longitude, latitude pairs.

"},{"location":"sprite/","title":"Sprite","text":"

Loading a sprite can be done using the optional sprite property at the root level of a MapLibre style sheet.

The images contained in the sprite can be referenced in other style properties (background-pattern, fill-pattern, line-pattern,fill-extrusion-pattern and icon-image).

"},{"location":"sprite/#usage","title":"Usage","text":"

You need to pass an URL where the sprite can be loaded from.

\"sprite\": \"https://demotiles.maplibre.org/styles/osm-bright-gl-style/sprite\"\n

This will load both an image by appending .png and the metadata about the sprite needed for loading by appending .json. See for yourself:

More details about the exact requirements on the format of these files is provided in the next section.

When a sprite is provided, you can refer to the images in the sprite in other parts of the style sheet. For example, when creating a symbol layer with the layout property \"icon-image\": \"poi\". Or with the tokenized value \"icon-image\": \"{icon}\" and vector tile features with an icon property with the value poi.

"},{"location":"sprite/#multiple-sprite-sources","title":"Multiple Sprite Sources","text":"

You can also supply an array of { id: ..., url: ... } pairs to load multiple sprites:

\"sprite\": [\n  {\n    id: 'roadsigns',\n    url: 'https://example.com/myroadsigns'\n  },\n  {\n    id: 'shops',\n    url: 'https://example2.com/someurl'\n  },\n  {\n    id: 'default',\n    url: 'https://example2.com/anotherurl'\n  }\n]\n

As you can see, each sprite has an id. All images contained within a sprite also have an id. When using multiple sprites, you need to prefix the id of the image with the id of the sprite it is contained within, followed by a colon. For example, to reference the stop_sign image on the roadsigns sprite, you would need to use roadsigns:stop_sign.

The sprite with id default is special in that you do not need to prefix the images contained within it. For example, to reference the image with id airport in the default sprite above, you can simply use airport.

"},{"location":"sprite/#sprite-source-format","title":"Sprite Source Format","text":"

A valid sprite source must supply two types of files:

{\n    \"poi\": {\n        \"width\": 32,\n        \"height\": 32,\n        \"x\": 0,\n        \"y\": 0,\n        \"pixelRatio\": 1\n    }\n}\n
SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality \u2705 \u2705 \u2705 textFitWidth, textFitHeight 4.2.0 11.4.0 6.6.0"},{"location":"sprite/#optional-properties","title":"Optional Properties","text":"

Apart from these required properties, the following optional properties are supported:

"},{"location":"sprite/#stretch-properties","title":"Stretch Properties","text":"

The following image gives a bit more infomation regarding the stretch properties:

{\n    \"shield\": {\n        \"width\": 25,\n        \"height\": 30,\n        \"x\": 0,\n        \"y\": 0,\n        \"stretchX\": [[5, 10], [15, 20]]\n        \"stretchY\": [[5, 20]]\n        \"pixelRatio\": 1\n    }\n}\n
The red highlighted part is where the stretch will occur over the Y axis and the blue highlight is for the X axis.

"},{"location":"sprite/#text-fit-properties","title":"Text Fit Properties","text":"

The properties textFitWidth and textFitHeight alter how a sprite's content rectangle maps to its contents when scaling a sprite. These properties are defined with the enum TextFit which may have the following values: * stretchOrShrink (or omitted) * stretchOnly * proportional

The primary use cases of interest are: 1. Both properties are undefined or stretchOrShrink

The content rectangle scales precisely to contain its contents.

  1. textFitWidth = stretchOnly and textFitHeight = proportional

The content rectangle scales to precisely contain the height of its contents but the width will not shrink smaller than the aspect ratio of the original content rectangle. This is primarily useful for shields that shouldn't become too narrow if their contents are narrow (like the number \"1\").

  1. textFitWidth = proportional and textFitHeight = stretchOnly

The content rectangle scales to precisely contain the width of its contents but the height will not shrink smaller than the aspect ratio of the original content rectangle. This may be useful scenarios like no. 2 except with vertically written scripts (using \"text-writing-mode\": [\"vertical\"]).

"},{"location":"sprite/#high-dpi-devices","title":"High-DPI Devices","text":"

On high-DPI devices, @2x is appended to the URLs described above. For example, if you specified \"sprite\": \"https://example.com/sprite\", renderers would load https://example.com/sprite.json and https://example.com/sprite.png, or https://example.com/sprite@2x.json and https://example.com/sprite@2x.png.

"},{"location":"sprite/#generating-sprites","title":"Generating Sprites","text":"

There are tools that can generate sprites from SVG files, such as spreet and spritezero.

"},{"location":"terrain/","title":"Terrain","text":"

The terrain configuration.

terrain: {\"source\": \"raster-dem-source\", \"exaggeration\": 0.5}\n
"},{"location":"terrain/#source","title":"source","text":"

Required string.

The source for the terrain data.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 2.2.0 \u274c (#252) \u274c (#252)"},{"location":"terrain/#exaggeration","title":"exaggeration","text":"

Optional number in range [0, \u221e). Defaults to 1.

The exaggeration of the terrain - how high it will look.

SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS basic functionality 2.2.0 \u274c (#252) \u274c (#252)"},{"location":"transition/","title":"Transition","text":"

A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's transition property.

transition: {\"duration\": 300, \"delay\": 0}\n
"},{"location":"transition/#duration","title":"duration","text":"

Optional number in range [0, \u221e). Units in milliseconds. Defaults to 300.

Time allotted for transitions to complete.

"},{"location":"transition/#delay","title":"delay","text":"

Optional number in range [0, \u221e). Units in milliseconds. Defaults to 0.

Length of time before a transition begins.

"},{"location":"types/","title":"Types","text":"

MapLibre style contains values of various types, most commonly as values for the style properties of a layer.

"},{"location":"types/#color","title":"Color","text":"

The color type is a color in the sRGB color space. Colors are JSON strings in a variety of permitted formats: HTML-style hex values, RGB, RGBA, HSL, and HSLA. Predefined HTML colors names, like yellow and blue, are also permitted.

{\n    \"line-color\": \"#ff0\",\n    \"line-color\": \"#ffff00\",\n    \"line-color\": \"rgb(255, 255, 0)\",\n    \"line-color\": \"rgba(255, 255, 0, 1)\",\n    \"line-color\": \"hsl(100, 50%, 50%)\",\n    \"line-color\": \"hsla(100, 50%, 50%, 1)\",\n    \"line-color\": \"yellow\"\n}\n
"},{"location":"types/#formatted","title":"Formatted","text":"

The formatted type is a string broken into sections annotated with separate formatting options.

{\n    \"text-field\": [\"format\",\n        \"foo\", { \"font-scale\": 1.2 },\n        \"bar\", { \"font-scale\": 0.8 }\n    ]\n}\n
"},{"location":"types/#resolvedimage","title":"ResolvedImage","text":"

The resolvedImage type is an image (e.g., an icon or pattern) which is used in a layer. An input to the image expression operator is checked against the current map style to see if it is available to be rendered or not, and the result is returned in the resolvedImage type. This approach allows developers to define a series of images which the map can fall back to if previous images are not found, which cannot be achieved by providing, for example, icon-image with a plain string (because multiple strings cannot be supplied to icon-image and multiple images cannot be defined in a string).

{\n    \"icon-image\": [\"coalesce\", [\"image\", \"myImage\"], [\"image\", \"fallbackImage\"]]\n}\n
"},{"location":"types/#string","title":"String","text":"

A string is text. In MapLibre styles, strings are in quotes.

{\n    \"source\": \"mySource\"\n}\n
"},{"location":"types/#boolean","title":"Boolean","text":"

Boolean means yes or no, so it accepts the values true or false.

{\n    \"fill-enabled\": true\n}\n
"},{"location":"types/#number","title":"Number","text":"

A number value, often an integer or floating point (decimal number). Written without quotes.

{\n    \"text-size\": 24\n}\n
"},{"location":"types/#array","title":"Array","text":"

Arrays are comma-separated lists of one or more values in a specific order. For example, they're used in line dash arrays, in which the numbers specify intervals of line, break, and line again. If an array is used as an argument in an expression, the array must be wrapped in a literal expression.

{\n    \"line-dasharray\": [2, 4]\n}\n\n{\n    \"circle-color\": [\"in\", 1, [\"literal\", [1, 2, 3]]]\n}\n
"},{"location":"types/#point","title":"Point","text":"

Points are two-element numeric arrays representing [x, y] coordinate pairs. Units and other interpretations of the x/y values depend on where and how the point type is used.

{\n    \"line-translate\": [2, 4]\n}\n
"},{"location":"types/#enum","title":"Enum","text":"

Enums are a closed set of possible string values. Failing to provide a value within the closed set will result in an error.

{\n    \"circle-translate-anchor\": \"viewport\"\n}\n
"},{"location":"types/#padding","title":"Padding","text":"SDK Support MapLibre GL JS MapLibre NativeAndroid MapLibre NativeiOS Single number 0.10.0 2.0.1 2.0.0 Array of numbers 2.2.0 11.5.0 6.7.0

An array of numbers with syntax similar to CSS:

A single number is accepted for backwards-compatibility, and treated the same as a one-element array \u2014 padding applied to all sides.

The following example applies 2em padding on top and bottom and 3em padding left and right.

{\n    \"icon-padding\": [2, 3]\n}\n
"}]} \ No newline at end of file diff --git a/types/index.html b/types/index.html index c25ddb316..c3fe4fe4e 100644 --- a/types/index.html +++ b/types/index.html @@ -917,8 +917,8 @@

Padding#2363) -❌ (#2363) +11.5.0 +6.7.0