Expression

class Expression : Value

An expression defines a formula for computing the value of any layout property, paint property, or filter within a map style. Expressions allow you to style data with multiple feature properties at once, apply conditional logic, and manipulate data with mathematical, logical, and string operators. This allows for sophisticated runtime styling.

Types

Builder
Link copied to clipboard
abstract class Builder(operator: String)
Abstract base builder.
CollatorBuilder
Link copied to clipboard
class CollatorBuilder : Expression.Builder
Builder for Collator expression.
Companion
Link copied to clipboard
object Companion
Static variables and methods.
ExpressionBuilder
Link copied to clipboard
open class ExpressionBuilder(operator: String) : Expression.Builder
Builder for Expression.
FormatBuilder
Link copied to clipboard
class FormatBuilder : Expression.Builder
Builder for Formatted TextField.
FormatSectionBuilder
Link copied to clipboard
class FormatSectionBuilder(content: Expression)
Builder for a Formatted Section.
InterpolatorBuilder
Link copied to clipboard
class InterpolatorBuilder(operator: String) : Expression.ExpressionBuilder
Builder for Interpolate Expression.
NumberFormatBuilder
Link copied to clipboard
class NumberFormatBuilder(input: Expression) : Expression.Builder
Builder for Number Format expression.

Functions

equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
getContents
Link copied to clipboard
open fun getContents(): Any?
getLiteral
Link copied to clipboard
inline fun <T> getLiteral(): T?
Get the literal value of the expression as given type.
hashCode
Link copied to clipboard
open override fun hashCode(): Int
isLiteral
Link copied to clipboard
fun isLiteral(): Boolean
Check if the expression is literal.
toJson
Link copied to clipboard
open fun toJson(): String
toString
Link copied to clipboard
open override fun toString(): String

Properties

literalValue
Link copied to clipboard
var literalValue: Any? = null
Return Expression as literal Value.