id
stringlengths
16
145
text
stringlengths
1
179k
title
stringclasses
1 value
mapbox_expressions_layers/mapbox_layers_2_0.txt
## Layer properties ​
mapbox_expressions_layers/types2_10_0.txt
Join the Mapbox Developers Discord Community arrow-right A Mapbox style contains values of various types, most commonly as values for the style properties of a layer.
mapbox_expressions_layers/mapbox_expressions_7_0.txt
## array ​ 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]: array clipboard ...
mapbox_expressions_layers/color-switcher3_4_0.txt
Maps Navigation Search Data Help All docs
mapbox_expressions_layers/mapbox_expressions_13_0.txt
## number ​ 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]: number clipboard ["number", value, f...
mapbox_expressions_layers/mapbox_layers_8_0.txt
## metadata ​ Optional . Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'.
mapbox_expressions_layers/mapbox_expressions_72_0.txt
## to-rgba ​ Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order. ### Syntax ["to-rgba", color]: array<number, 4> clipboard SDK Support | Mapbox GL JS | Android SDK | iOS SDK ---|---|---|--- basic functionality | >= ...
mapbox_expressions_layers/types2_2_0.txt
Search Data
mapbox_expressions_layers/mapbox_layers_3_0.txt
## id ​ Required [ string ](/style-spec/reference/types/#string) . Unique layer name.
mapbox_expressions_layers/mapbox_layers_19_1.txt
` "map" ` : Circles are scaled according to their apparent distance to the camera. ` "viewport" ` : Circles are not scaled. SDK Support | Mapbox GL JS | Android SDK | iOS SDK ---|---|---|--- basic functionality | >= 0.21.0 | >= 4.2.0 | >= 3.4.0 ### circle-radius ​ [ Paint ](/...
mapbox_expressions_layers/types2_17_0.txt
clipboard ## String ​
mapbox_expressions_layers/115275_4_0.txt
Host and manage packages * Security
mapbox_expressions_layers/mapbox_layers_17_5.txt
t key. SDK Support | Mapbox GL JS | Android SDK | iOS SDK ---|---|---|--- basic functionality | >= 0.53.0 | >= 7.4.0 | >= 4.11.0 data-driven styling | >= 0.53.0 | >= 7.4.0 | >= 4.11.0 ### symbol-spacing ​ [ Layout ](/style-spec/reference/layers/#layout-property) property. Optional...
mapbox_expressions_layers/115275_56_0.txt
© 2024 GitHub, Inc. ### Footer navigation
mapbox_expressions_layers/color-switcher3_11_0.txt
# Change a layer's color with buttons Join the Mapbox Developers Discord Community arrow-right
mapbox_expressions_layers/mapbox_expressions_44_0.txt
## == ​ 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 ` ...
mapbox_expressions_layers/mapbox-gl-style-line-color-based-on-property-text-value5_78_0.txt
Site design / logo © 2024 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2024.4.30.8466
mapbox_expressions_layers/mapbox_expressions_78_0.txt
## ^ ​ Returns the result of raising the first input to the power specified by the second. ### Syntax ["^", number, number]: number clipboard SDK Support | Mapbox GL JS | Android SDK | iOS SDK ---|---|---|--- basic functionality | >= 0.41.0 | >= 6.0.0 | >= 4.0.0
mapbox_expressions_layers/mapbox_expressions_17_0.txt
## to-boolean ​ 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 clipboard SDK Support | Mapbox GL JS | Android SDK | iOS SDK...
mapbox_expressions_layers/color-switcher3_15_0.txt
Was this example helpful? Yes No © Mapbox All Rights Reserved Terms Privacy Security Your California Privacy Choices
mapbox_expressions_layers/115275_43_0.txt
map.setPaintProperty( 'layerName', 'fill-color', ["case", ["==", ["get", key], null], "#ffffff", [ "interpolate", ["linear"], ["get", key], ...
mapbox_expressions_layers/mapbox_expressions_14_0.txt
## number-format ​ 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 ` uni...
mapbox_expressions_layers/mapbox_expressions_0_0.txt
Skip to main content [ ](https://www.mapbox.com) [ Docs ](https://docs.mapbox.com) [ Maps ](https://docs.mapbox.com/#maps) [ Navigation ](https://docs.mapbox.com/#navigation) [ Search ](https://docs.mapbox.com/#search) [ Data ](https://docs.mapbox.com/#data) [ Help ](https://docs.mapbox.com/help/) [ ](https://w...
mapbox_expressions_layers/mapbox_expressions_40_0.txt
## ! ​ Logical negation. Returns ` true ` if the input is ` false ` , and ` false ` if the input is ` true ` . ### Syntax ["!", boolean]: boolean clipboard ### Related * [ Example: Create and style clusters ](https://docs.mapbox.com/mapbox-gl-js/example/cluster/) SDK Support | Mapb...
mapbox_expressions_layers/types2_9_0.txt
## On this page * Color * Formatted * ResolvedImage * String * Boolean * Number * Array
mapbox_expressions_layers/types2_8_0.txt
# Types Search Style Specification
mapbox_expressions_layers/mapbox_expressions_99_0.txt
## sqrt ​ Returns the square root of the input. ### Syntax ["sqrt", number]: number clipboard SDK Support | Mapbox GL JS | Android SDK | iOS SDK ---|---|---|--- basic functionality | >= 0.42.0 | >= 6.0.0 | >= 4.0.0
mapbox_expressions_layers/mapbox_layers_17_4.txt
interpolate ` ](/style-spec/reference/expressions/#interpolate) expressions. Size of the additional area added to dimensions determined by ` icon-text-fit ` , in clockwise order: top, right, bottom, left. SDK Support | Mapbox GL JS | Android SDK | iOS SDK ---|---|---|--- basic functionality | >= 0.21.0 ...
mapbox_expressions_layers/mapbox_expressions_104_0.txt
## zoom ​ Returns 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 clipboard ### Related * [ Tutorial: Get started with Mapbox GL JS expressions:...
mapbox_expressions_layers/mapbox_expressions_10_0.txt
## format ​ 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: * ` "text-font" ` : ...
mapbox_expressions_layers/mapbox-gl-style-line-color-based-on-property-text-value5_67_0.txt
0 mapbox-gl-draw data driven style on LineString
mapbox_expressions_layers/color-switcher3_0_0.txt
Skip to main content Docs
mapbox_expressions_layers/mapbox_expressions_98_0.txt
## sin ​ Returns the sine of the input. ### Syntax ["sin", number]: number clipboard SDK Support | Mapbox GL JS | Android SDK | iOS SDK ---|---|---|--- basic functionality | >= 0.41.0 | >= 6.0.0 | >= 4.0.0
mapbox_expressions_layers/mapbox_expressions_25_0.txt
## geometry-type ​ Returns the feature's geometry type: ` Point ` , ` LineString ` or ` Polygon ` . ` Multi* ` feature types return the singular forms. ### Syntax ["geometry-type"]: string clipboard SDK Support | Mapbox GL JS | Android SDK | iOS SDK ---|---|---|--- basic functi...
mapbox_expressions_layers/mapbox_expressions_38_0.txt
## slice ​ 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. ### Syntax ["slice", input: InputType (array or string), ...
mapbox_expressions_layers/mapbox_layers_23_1.txt
ssion using ` sky-radial-progress ` . The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, ` sky-gradient-radius ` ] centered at the position specified by ` sky- gradient-center ` . SDK Support | Mapbox GL JS | Android SDK | iOS SDK ---|---|---|--- basic functionality | >= 2.0...
mapbox_expressions_layers/mapbox-gl-style-line-color-based-on-property-text-value5_0_0.txt
Skip to main content Stack Overflow
mapbox_expressions_layers/115275_32_0.txt
Sign up for GitHub By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.
mapbox_expressions_layers/115275_55_0.txt
2 participants ## Footer
mapbox_expressions_layers/color-switcher3_7_0.txt
* API Reference chevron-down * Plugins and frameworks
mapbox_expressions_layers/types2_3_0.txt
Help Docs
mapbox_expressions_layers/mapbox_expressions_54_0.txt
## interpolate ​ 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<nu...
mapbox_expressions_layers/115275_20_0.txt
Search Clear
mapbox_expressions_layers/types2_25_0.txt
clipboard Join the Mapbox Developers Discord Community arrow-right
mapbox_expressions_layers/115275_18_0.txt
* Topics * Trending * Collections * Pricing
mapbox_expressions_layers/types2_4_0.txt
Maps Navigation Search Data Help All docs
mapbox_expressions_layers/mapbox_expressions_91_0.txt
## log10 ​ Returns the base-ten logarithm of the input. ### Syntax ["log10", number]: number clipboard SDK Support | Mapbox GL JS | Android SDK | iOS SDK ---|---|---|--- basic functionality | >= 0.41.0 | >= 6.0.0 | >= 4.0.0
mapbox_expressions_layers/mapbox-gl-style-line-color-based-on-property-text-value5_46_0.txt
To learn more, see our tips on writing great answers . Draft saved
mapbox_expressions_layers/115275_19_0.txt
Search or jump to... # Search code, repositories, users, issues, pull requests...
mapbox_expressions_layers/115275_54_0.txt
Development No branches or pull requests
mapbox_expressions_layers/mapbox_expressions_43_0.txt
## <= ​ 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 ...
mapbox_expressions_layers/mapbox_expressions_42_0.txt
## < ​ 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 consi...
mapbox_expressions_layers/mapbox-gl-style-line-color-based-on-property-text-value5_28_0.txt
Improve this question Follow
mapbox_expressions_layers/115275_39_0.txt
edited Hello i am displaying polygones/zones that are colored depending on the given value range. But some of these zones got values of null ,0 or undefined or the "key" property itself is missing in the data, so the mapboxgl automatically sets default color for them "black" . I am setting the colors this way: ` map....
mapbox_expressions_layers/types2_24_0.txt
Arrays are comma-separated lists of one or more numbers 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. { ...
mapbox_expressions_layers/mapbox-gl-style-line-color-based-on-property-text-value5_73_0.txt
To subscribe to this RSS feed, copy and paste this URL into your RSS reader. ##### Stack Overflow
mapbox_expressions_layers/mapbox_expressions_66_0.txt
## upcase ​ 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 clipboard ### Related * [ Example: Change the case of la...
mapbox_expressions_layers/mapbox_layers_4_0.txt
## type ​ Required [ enum ](/style-spec/reference/types/#enum) . One of ` "fill" ` , ` "line" ` , ` "symbol" ` , ` "circle" ` , ` "heatmap" ` , ` "fill-extrusion" ` , ` "raster" ` , ` "hillshade" ` , ` "model" ` , ` "background" ` , ` "sky" ` , ` "slot" ` . Rendering type of this layer. ` "fill" ` : A ...
mapbox_expressions_layers/115275_41_0.txt
Author ###
mapbox_expressions_layers/mapbox_expressions_87_0.txt
## e ​ Returns the mathematical constant e. ### Syntax ["e"]: number clipboard SDK Support | Mapbox GL JS | Android SDK | iOS SDK ---|---|---|--- basic functionality | >= 0.41.0 | >= 6.0.0 | >= 4.0.0
mapbox_expressions_layers/color-switcher3_12_0.txt
This example uses ` setPaintProperty ` to change the colors of different ` fill ` layers on a map: * The ` water ` and ` building ` layers use the Mapbox Streets v8 vector tileset from the Mapbox Light style ( ` light-v10 ` ) as a ` vector ` source .
mapbox_expressions_layers/mapbox-gl-style-line-color-based-on-property-text-value5_23_0.txt
{ "type": "FeatureCollection", "name": "lineData", "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, "features": [ { "type": "Feature", "properties": { "Need": "Urgent" }, "geometry": { "type": "MultiLineString", "coordinates": [ [ [ 10.6...
mapbox_expressions_layers/mapbox-gl-style-line-color-based-on-property-text-value5_69_0.txt
0 Mapbox GL JS Change the fill-color's property value based on an expression
mapbox_expressions_layers/mapbox_layers_17_1.txt
/expressions/#interpolate) expressions. opacity Transitionable. Controls the intensity of light emitted on the source features. SDK Support | Mapbox GL JS | Android SDK | iOS SDK ---|---|---|--- basic functionality | >= 3.0.0 | >= 11.0.0 | >= 11.0.0 data-driven styling | >= 3.0.0 | >= 11.0.0...
mapbox_expressions_layers/mapbox-gl-style-line-color-based-on-property-text-value5_12_0.txt
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams Create a free Team
mapbox_expressions_layers/mapbox-gl-style-line-color-based-on-property-text-value5_4_0.txt
* Meta Stack Overflow ### your communities
mapbox_expressions_layers/color-switcher3_2_0.txt
Search Data
mapbox_expressions_layers/115275_1_0.txt
Toggle navigation Sign in
mapbox_expressions_layers/115275_31_0.txt
New issue Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
mapbox_expressions_layers/mapbox-gl-style-line-color-based-on-property-text-value5_20_0.txt
Modified 2 years, 3 months ago Viewed 3k times
mapbox_expressions_layers/mapbox_layers_20_0.txt
## fill-extrusion ​ A ` fill-extrusion ` style layer renders one or more filled (and optionally stroked) extruded (3D) polygons on a map. You can use a fill-extrusion layer to configure the extrusion and visual appearance of polygon or multipolygon features. This map uses an external dataset to provide data-drive...
mapbox_expressions_layers/mapbox_layers_20_1.txt
e) expressions. opacity 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-extrusio...
mapbox_expressions_layers/115275_52_0.txt
Projects None yet
mapbox_expressions_layers/115275_15_0.txt
* Open Source * GitHub Sponsors
mapbox_expressions_layers/mapbox-gl-style-line-color-based-on-property-text-value5_32_0.txt
## 1 Answer 1 Sorted by: Reset to default
mapbox_expressions_layers/115275_3_0.txt
Automate any workflow * Packages
mapbox_expressions_layers/mapbox_expressions_56_0.txt
## interpolate-lab ​ 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", ...
mapbox_expressions_layers/mapbox_expressions_97_0.txt
## round ​ 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 clipboard SDK Support | Mapbox GL JS | Android SDK | iOS SDK ---|---|---|--- basic functionality...
mapbox_expressions_layers/mapbox_layers_16_3.txt
equires_ line-translate . Controls the frame of reference for ` line-translate ` . ` "map" ` : The line is translated relative to the map. ` "viewport" ` : The line is translated relative to the viewport. SDK Support | Mapbox GL JS | Android SDK | iOS SDK ---|---|---|--- basic functionalit...
mapbox_expressions_layers/mapbox_layers_17_3.txt
of ` icon-rotation-alignment ` . SDK Support | Mapbox GL JS | Android SDK | iOS SDK ---|---|---|--- basic functionality | >= 0.39.0 | >= 5.2.0 | >= 3.7.0 ### icon-rotate ​ [ Layout ](/style-spec/reference/layers/#layout-property) property. Optional [ number ](/style-spec/reference/types/#...
mapbox_expressions_layers/mapbox_expressions_81_0.txt
## acos ​ Returns the arccosine of the input. ### Syntax ["acos", number]: number clipboard SDK Support | Mapbox GL JS | Android SDK | iOS SDK ---|---|---|--- basic functionality | >= 0.41.0 | >= 6.0.0 | >= 4.0.0
mapbox_expressions_layers/115275_38_0.txt
### erkanisuf commented Feb 18, 2022 •
mapbox_expressions_layers/mapbox_expressions_70_0.txt
## rgb ​ 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 clipboard SDK Support | Mapbox GL JS | ...
mapbox_expressions_layers/mapbox_layers_23_0.txt
## sky ​ Warning As of [ v2.9.0 ](https://github.com/mapbox/mapbox-gl-js/releases/tag/v2.9.0) , [ fog ](/style-spec/reference/fog/) is the preferred method for atmospheric styling. Sky layer is not supported by the [ globe ](https://docs.mapbox.com/mapbox-gl-js/guides/projections/#globe) projection, and will be p...
mapbox_expressions_layers/mapbox_expressions_76_0.txt
## / ​ Returns the result of floating point division of the first input by the second. ### Syntax ["/", number, number]: number clipboard ### Related * [ Tutorial: Get started with Mapbox GL JS expressions: Adjust the circle radius ](https://docs.mapbox.com/help/tutorials/mapbox-gl-js...
mapbox_expressions_layers/mapbox_expressions_95_0.txt
## pi ​ Returns the mathematical constant pi. ### Syntax ["pi"]: number clipboard SDK Support | Mapbox GL JS | Android SDK | iOS SDK ---|---|---|--- basic functionality | >= 0.41.0 | >= 6.0.0 | >= 4.0.0
mapbox_expressions_layers/mapbox_expressions_90_0.txt
## ln2 ​ Returns mathematical constant ln(2). ### Syntax ["ln2"]: number clipboard SDK Support | Mapbox GL JS | Android SDK | iOS SDK ---|---|---|--- basic functionality | >= 0.41.0 | >= 6.0.0 | >= 4.0.0
mapbox_expressions_layers/mapbox_layers_18_2.txt
e image will be drawn. SDK Support | Mapbox GL JS | Android SDK | iOS SDK ---|---|---|--- basic functionality | >= 0.10.0 | >= 2.0.1 | >= 2.0.0 ### raster-resampling ​ [ Paint ](/style-spec/reference/layers/#paint-property) property. Optional [ enum ](/style-spec/reference/types/#enum) . ...
mapbox_expressions_layers/115275_6_0.txt
Instant dev environments * Copilot
mapbox_expressions_layers/mapbox-gl-style-line-color-based-on-property-text-value5_48_0.txt
Sign up using Google Sign up using Facebook
mapbox_expressions_layers/mapbox-gl-style-line-color-based-on-property-text-value5_24_0.txt
I've read about styling expressions at mapbox, and I believe the "feature- state" is key to solving this, but I cant wrap my head around how to get the color converted from a feature. If this in the rendering:
mapbox_expressions_layers/115275_30_0.txt
Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights
mapbox_expressions_layers/mapbox-gl-style-line-color-based-on-property-text-value5_26_0.txt
const layerStyleTheLines = { id: 'style_it_to_red', type: 'line', paint: { 'line-color': [ [["==", ["feature-state", "Need"], "Urgent"],"red"], [["==", ["feature-state", "Need"], "Medium"],"yellow"], [["==", ["feature-state", "Need"], "Starting"],"gr...
mapbox_expressions_layers/mapbox_expressions_5_0.txt
## Type system ​ 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 argu...
mapbox_expressions_layers/mapbox_expressions_83_0.txt
## atan ​ Returns the arctangent of the input. ### Syntax ["atan", number]: number clipboard SDK Support | Mapbox GL JS | Android SDK | iOS SDK ---|---|---|--- basic functionality | >= 0.41.0 | >= 6.0.0 | >= 4.0.0
mapbox_expressions_layers/mapbox_layers_17_6.txt
t is placed closest to the anchor. ` "right" ` : The right side of the text is placed closest to the anchor. ` "top" ` : The top of the text is placed closest to the anchor. ` "bottom" ` : The bottom of the text is placed closest to the anchor. ` "top-left" ` : The top left corner of the...
mapbox_expressions_layers/mapbox_expressions_62_0.txt
## concat ​ Returns a ` string ` consisting of the concatenation of the inputs. Each input is converted to a string as if by ` to-string ` . ### Syntax ["concat", value, value, ...]: string clipboard ### Related * [ Example: Add a generated icon to the map ](https://docs.mapbox.com/ma...
mapbox_expressions_layers/types2_13_0.txt
Especially of note is the support for HSL, which can be easier to reason about than RGB . ## Formatted ​
mapbox_expressions_layers/mapbox_expressions_4_0.txt
## Composition ​ A single expression can 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. { "circle-radius": [ ...
mapbox_expressions_layers/mapbox_layers_17_9.txt
mber) greater than or equal to ` 0 ` . Units in pixels . Defaults to ` 2 ` . _Requires_ text-field . Supports [ smooth-ramp ` interpolate ` ](/style- spec/reference/expressions/#interpolate) expressions. Size of the additional area around the text bounding box used for detecting symbol collisions. SDK Support...