Companion

object Companion

Static variables and methods.

Functions

abs
Link copied to clipboard
fun abs(vararg expressions: Expression): Expression
Returns the absolute value of the input.
fun abs(value: Double): Expression
Returns the absolute value of the input.
fun abs(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "abs".
accumulated
Link copied to clipboard
fun accumulated(): Expression
Gets the value of a cluster property accumulated so far.
acos
Link copied to clipboard
fun acos(vararg expressions: Expression): Expression
Returns the arccosine of the input.
fun acos(value: Double): Expression
Returns the arccosine of the input.
fun acos(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "acos".
all
Link copied to clipboard
fun all(vararg expressions: Expression): Expression
Returns true if all the inputs are true, false otherwise.
fun all(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "all".
any
Link copied to clipboard
fun any(vararg expressions: Expression): Expression
Returns true if any of the inputs are true, false otherwise.
fun any(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "any".
array
Link copied to clipboard
fun array(vararg expressions: Expression): Expression
Asserts that the input is an array (optionally with a specific item type and length).
fun array(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "array".
asin
Link copied to clipboard
fun asin(vararg expressions: Expression): Expression
Returns the arcsine of the input.
fun asin(value: Double): Expression
Returns the arcsine of the input.
fun asin(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "asin".
at
Link copied to clipboard
fun at(vararg expressions: Expression): Expression
Retrieves an item from an array.
fun at(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "at".
fun at(index: Double, array: Expression): Expression
Retrieves an item from an array.
atan
Link copied to clipboard
fun atan(vararg expressions: Expression): Expression
Returns the arctangent of the input.
fun atan(value: Double): Expression
Returns the arctangent of the input.
fun atan(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "atan".
boolean
Link copied to clipboard
fun boolean(vararg expressions: Expression): Expression
Asserts that the input value is a boolean.
fun boolean(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "boolean".
ceil
Link copied to clipboard
fun ceil(vararg expressions: Expression): Expression
Returns the smallest integer that is greater than or equal to the input.
fun ceil(value: Double): Expression
Returns the smallest integer that is greater than or equal to the input.
fun ceil(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "ceil".
coalesce
Link copied to clipboard
fun coalesce(vararg expressions: Expression): Expression
Evaluates each expression in turn until the first non-null value is obtained, and returns that value.
fun coalesce(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "coalesce".
collator
Link copied to clipboard
fun collator(block: Expression.CollatorBuilder.() -> Unit): Expression
Dsl function for "collator".
fun collator(caseSensitive: Expression, diacriticSensitive: Expression, locale: Expression): Expression
Returns a collator for use in locale-dependent comparison operations.
fun collator(caseSensitive: Boolean = false, diacriticSensitive: Boolean = false, locale: Locale): Expression
Returns a collator for use in locale-dependent comparison operations.
fun collator(caseSensitive: Boolean = false, diacriticSensitive: Boolean = false, locale: String): Expression
Returns a collator for use in locale-dependent comparison operations.
color
Link copied to clipboard
fun color(@ColorInt() intColor: Int): Expression
Convert a color int to the rgba expression.
concat
Link copied to clipboard
fun concat(vararg expressions: Expression): Expression
Returns a string consisting of the concatenation of the inputs.
fun concat(vararg values: String): Expression
Returns a string consisting of the concatenation of the inputs.
fun concat(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "concat".
cos
Link copied to clipboard
fun cos(vararg expressions: Expression): Expression
Returns the cosine of the input.
fun cos(value: Double): Expression
Returns the cosine of the input.
fun cos(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "cos".
cubicBezier
Link copied to clipboard
fun cubicBezier(block: Expression.ExpressionBuilder.() -> Unit): <ERROR CLASS>
Interpolates using the cubic bezier curve defined by the given control points.
fun cubicBezier(x1: Expression, x2: Expression, x3: Expression, x4: Expression): <ERROR CLASS>
Interpolates using the cubic bezier curve defined by the given control points.
distance
Link copied to clipboard
fun distance(geojson: GeoJson): Expression
Returns the shortest distance in meters between the evaluated feature and the input geometry.
division
Link copied to clipboard
fun division(vararg expressions: Expression): Expression
Returns the result of floating point division of the first input by the second.
fun division(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "/".
fun division(first: Double, second: Double): Expression
Returns the result of floating point division of the first input by the second.
downcase
Link copied to clipboard
fun downcase(vararg expressions: Expression): Expression
Returns the input string converted to lowercase.
fun downcase(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "downcase".
fun downcase(value: String): Expression
Returns the input string converted to lowercase.
e
Link copied to clipboard
fun e(): Expression
Returns the mathematical constant e.
eq
Link copied to clipboard
fun eq(vararg expressions: Expression): Expression
Returns true if the input values are equal, false otherwise.
fun eq(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "==".
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
exponential
Link copied to clipboard
fun exponential(expression: Expression): <ERROR CLASS>
Interpolates exponentially between the stops just less than and just greater than the input.
fun exponential(block: Expression.ExpressionBuilder.() -> Unit): <ERROR CLASS>
Interpolates exponentially between the stops just less than and just greater than the input.
featureState
Link copied to clipboard
fun featureState(vararg expressions: Expression): Expression
Retrieves a property value from the current feature's state.
fun featureState(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "feature-state".
floor
Link copied to clipboard
fun floor(vararg expressions: Expression): Expression
Returns the largest integer that is less than or equal to the input.
fun floor(value: Double): Expression
Returns the largest integer that is less than or equal to the input.
fun floor(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "floor".
format
Link copied to clipboard
fun format(vararg formatSections: FormatSection): Expression
Returns a formatted string for displaying mixed-format text in the text-field property.
fun format(block: Expression.FormatBuilder.() -> Unit): Expression
DSL function for "format".
fromRaw
Link copied to clipboard
fun fromRaw(expression: String): Expression
Construct Expression from a raw string.
geometryType
Link copied to clipboard
fun geometryType(): Expression
Gets the feature's geometry type: Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon.
get
Link copied to clipboard
fun get(vararg expressions: Expression): Expression
Retrieves a property value from the current feature's properties, or from another object if a second argument is provided.
fun get(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "get".
fun get(key: String): Expression
Retrieves a property value from the current feature's properties.
fun get(key: String, expression: Expression): Expression
Retrieves a property value from the current feature's properties, or from another object if a second argument is provided.
gt
Link copied to clipboard
fun gt(vararg expressions: Expression): Expression
Returns true if the first input is strictly greater than the second, false otherwise.
fun gt(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for ">".
gte
Link copied to clipboard
fun gte(vararg expressions: Expression): Expression
Returns true if the first input is greater than or equal to the second, false otherwise.
fun gte(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for ">=".
has
Link copied to clipboard
fun has(vararg expressions: Expression): Expression
Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.
fun has(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "has".
fun has(string: String): Expression
Tests for the presence of an property value in the current feature's properties
fun has(string: String, expression: Expression): Expression
Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.
hashCode
Link copied to clipboard
open fun hashCode(): Int
heatmapDensity
Link copied to clipboard
fun heatmapDensity(): Expression
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.
id
Link copied to clipboard
fun id(): Expression
Gets the feature's id, if it has one.
image
Link copied to clipboard
fun image(vararg expressions: Expression): Expression
Returns an image type for use in icon-image, --pattern entries and as a section in the format expression.
fun image(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "image".
indexOf
Link copied to clipboard
fun indexOf(vararg expressions: Expression): Expression
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.
fun indexOf(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "index-of".
inExpression
Link copied to clipboard
fun inExpression(vararg expressions: Expression): Expression
Determines whether an item exists in an array or a substring exists in a string.
fun inExpression(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "in".
fun inExpression(needle: Double, haystack: Expression): Expression
Determines whether an item exists in an array or a substring exists in a string.
fun inExpression(needle: String, haystack: Expression): Expression
Determines whether an item exists in an array or a substring exists in a string.
interpolate
Link copied to clipboard
fun interpolate(vararg expressions: Expression): Expression
Produces continuous, smooth results by interpolating between pairs of input and output values ("stops").
fun interpolate(block: Expression.InterpolatorBuilder.() -> Unit): Expression
DSL function for "interpolate".
isSupportedScript
Link copied to clipboard
fun isSupportedScript(vararg expressions: Expression): Expression
Returns true if the input string is expected to render legibly.
fun isSupportedScript(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "is-supported-script".
fun isSupportedScript(script: String): Expression
Returns true if the input string is expected to render legibly.
length
Link copied to clipboard
fun length(vararg expressions: Expression): Expression
Gets the length of an array or string.
fun length(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "length".
fun length(string: String): Expression
Gets the length of an string.
letExpression
Link copied to clipboard
fun letExpression(vararg expressions: Expression): Expression
Binds expressions to named variables, which can then be referenced in the result expression using "var", "variable_name".
fun letExpression(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "let".
linear
Link copied to clipboard
fun linear(): Expression
Interpolates linearly between the pair of stops just less than and just greater than the input.
lineProgress
Link copied to clipboard
fun lineProgress(): Expression
Gets the progress along a gradient line.
literal
Link copied to clipboard
fun literal(value: Boolean): Expression
Provides a literal array or object value.
fun literal(value: Double): Expression
Provides a literal array or object value.
fun literal(value: Long): Expression
Provides a literal array or object value.
fun literal(value: String): Expression
Provides a literal array or object value.
ln
Link copied to clipboard
fun ln(vararg expressions: Expression): Expression
Returns the natural logarithm of the input.
fun ln(value: Double): Expression
Returns the natural logarithm of the input.
fun ln(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "ln".
ln2
Link copied to clipboard
fun ln2(): Expression
Returns mathematical constant ln(2).
log10
Link copied to clipboard
fun log10(vararg expressions: Expression): Expression
Returns the base-ten logarithm of the input.
fun log10(value: Double): Expression
Returns the base-ten logarithm of the input.
fun log10(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "log10".
log2
Link copied to clipboard
fun log2(vararg expressions: Expression): Expression
Returns the base-two logarithm of the input.
fun log2(value: Double): Expression
Returns the base-two logarithm of the input.
fun log2(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "log2".
lt
Link copied to clipboard
fun lt(vararg expressions: Expression): Expression
Returns true if the first input is strictly less than the second, false otherwise.
fun lt(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "<".
lte
Link copied to clipboard
fun lte(vararg expressions: Expression): Expression
Returns true if the first input is less than or equal to the second, false otherwise.
fun lte(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "<=".
match
Link copied to clipboard
fun match(vararg expressions: Expression): Expression
Selects the output whose label value matches the input value, or the fallback value if no match is found.
fun match(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "match".
max
Link copied to clipboard
fun max(vararg expressions: Expression): Expression
Returns the maximum value of the inputs.
fun max(vararg values: Double): Expression
Returns the maximum value of the inputs.
fun max(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "max".
min
Link copied to clipboard
fun min(vararg expressions: Expression): Expression
Returns the minimum value of the inputs.
fun min(vararg values: Double): Expression
Returns the minimum value of the inputs.
fun min(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "min".
mod
Link copied to clipboard
fun mod(vararg expressions: Expression): Expression
Returns the remainder after integer division of the first input by the second.
fun mod(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "%".
fun mod(first: Double, second: Double): Expression
Returns the remainder after integer division of the first input by the second.
neq
Link copied to clipboard
fun neq(vararg expressions: Expression): Expression
Returns true if the input values are not equal, false otherwise.
fun neq(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "!=".
not
Link copied to clipboard
fun not(vararg expressions: Expression): Expression
Logical negation.
fun not(bool: Boolean): Expression
Logical negation.
fun not(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "!".
number
Link copied to clipboard
fun number(vararg expressions: Expression): Expression
Asserts that the input value is a number.
fun number(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "number".
numberFormat
Link copied to clipboard
fun numberFormat(number: Expression, block: Expression.NumberFormatBuilder.() -> Unit): Expression
DSL function for "number-format".
fun numberFormat(value: Double, block: Expression.NumberFormatBuilder.() -> Unit): Expression
Converts the input number into a string representation using the providing formatting rules.
fun numberFormat(number: Expression, locale: Expression? = null, currency: Expression? = null, minFractionDigits: Expression? = null, maxFractionDigits: Expression? = null): Expression
Converts the input number into a string representation using the providing formatting rules.
objectExpression
Link copied to clipboard
fun objectExpression(vararg expressions: Expression): Expression
Asserts that the input value is an object.
fun objectExpression(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "object".
pi
Link copied to clipboard
fun pi(): Expression
Returns the mathematical constant pi.
pow
Link copied to clipboard
fun pow(vararg expressions: Expression): Expression
Returns the result of raising the first input to the power specified by the second.
fun pow(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "^".
fun pow(first: Double, second: Double): Expression
Returns the result of raising the first input to the power specified by the second.
product
Link copied to clipboard
fun product(vararg expressions: Expression): Expression
Returns the product of the inputs.
fun product(vararg double: Double): Expression
Returns the product of the inputs.
fun product(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "*".
properties
Link copied to clipboard
fun properties(): Expression
Gets the feature properties object.
resolvedLocale
Link copied to clipboard
fun resolvedLocale(vararg expressions: Expression): Expression
Returns the IETF language tag of the locale being used by the provided collator.
fun resolvedLocale(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "resolved-locale".
rgb
Link copied to clipboard
fun rgb(vararg expressions: Expression): Expression
Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1.
fun rgb(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "rgb".
fun rgb(red: Double, green: Double, blue: Double): Expression
Construct a RGB color expression from numbers.
rgba
Link copied to clipboard
fun rgba(vararg expressions: Expression): Expression
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.
fun rgba(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "rgba".
fun rgba(red: Double, green: Double, blue: Double, alpha: Double): Expression
Construct a RGBA color expression from numbers.
round
Link copied to clipboard
fun round(vararg expressions: Expression): Expression
Rounds the input to the nearest integer.
fun round(value: Double): Expression
Rounds the input to the nearest integer.
fun round(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "round".
sin
Link copied to clipboard
fun sin(vararg expressions: Expression): Expression
Returns the sine of the input.
fun sin(value: Double): Expression
Returns the sine of the input.
fun sin(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "sin".
skyRadialProgress
Link copied to clipboard
fun skyRadialProgress(): Expression
Gets the distance of a point on the sky from the sun position.
slice
Link copied to clipboard
fun slice(vararg expressions: Expression): Expression
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.
fun slice(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "slice".
sqrt
Link copied to clipboard
fun sqrt(vararg expressions: Expression): Expression
Returns the square root of the input.
fun sqrt(value: Double): Expression
Returns the square root of the input.
fun sqrt(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "sqrt".
step
Link copied to clipboard
fun step(vararg expressions: Expression): Expression
Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops").
fun step(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "step".
string
Link copied to clipboard
fun string(vararg expressions: Expression): Expression
Asserts that the input value is a string.
fun string(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "string".
subtract
Link copied to clipboard
fun subtract(vararg expressions: Expression): Expression
For two inputs, returns the result of subtracting the second input from the first.
fun subtract(value: Double): Expression
Returns the result of subtracting it from 0.
fun subtract(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "-".
fun subtract(first: Double, second: Double): Expression
Returns the result of subtracting the second input from the first.
sum
Link copied to clipboard
fun sum(vararg expressions: Expression): Expression
Returns the sum of the inputs.
fun sum(vararg double: Double): Expression
Returns the sum of the inputs.
fun sum(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "+".
switchCase
Link copied to clipboard
fun switchCase(vararg expressions: Expression): Expression
Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.
fun switchCase(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "case".
tan
Link copied to clipboard
fun tan(vararg expressions: Expression): Expression
Returns the tangent of the input.
fun tan(value: Double): Expression
Returns the tangent of the input.
fun tan(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "tan".
toBoolean
Link copied to clipboard
fun toBoolean(vararg expressions: Expression): Expression
Converts the input value to a boolean.
fun toBoolean(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "to-boolean".
toColor
Link copied to clipboard
fun toColor(vararg expressions: Expression): Expression
Converts the input value to a color.
fun toColor(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "to-color".
toNumber
Link copied to clipboard
fun toNumber(vararg expressions: Expression): Expression
Converts the input value to a number, if possible.
fun toNumber(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "to-number".
toRgba
Link copied to clipboard
fun toRgba(vararg expressions: Expression): Expression
Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.
fun toRgba(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "to-rgba".
toString
Link copied to clipboard
open fun toString(): String
fun toString(vararg expressions: Expression): Expression
Converts the input value to a string.
fun toString(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "to-string".
typeofExpression
Link copied to clipboard
fun typeofExpression(vararg expressions: Expression): Expression
Returns a string describing the type of the given value.
fun typeofExpression(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "typeof".
upcase
Link copied to clipboard
fun upcase(vararg expressions: Expression): Expression
Returns the input string converted to uppercase.
fun upcase(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "upcase".
fun upcase(value: String): Expression
Returns the input string converted to uppercase.
varExpression
Link copied to clipboard
fun varExpression(vararg expressions: Expression): Expression
References variable bound using "let".
fun varExpression(block: Expression.ExpressionBuilder.() -> Unit): Expression
DSL function for "var".
fun varExpression(value: String): Expression
References variable bound using "let".
within
Link copied to clipboard
fun within(geometry: Geometry): Expression
Returns true if the evaluated feature is fully contained inside a boundary of the input geometry, false otherwise.
zoom
Link copied to clipboard
fun zoom(): Expression
Gets the current zoom level.