Expression

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.

class Expression : Value

Types

Builder
Link copied to clipboard

Abstract base builder.

abstract class Builder(operator: String)
CollatorBuilder
Link copied to clipboard

Builder for Collator expression.

class CollatorBuilder : Expression.Builder
Companion
Link copied to clipboard

Static variables and methods.

object Companion
ExpressionBuilder
Link copied to clipboard

Builder for Expression.

open class ExpressionBuilder(operator: String) : Expression.Builder
FormatBuilder
Link copied to clipboard

Builder for Formatted TextField.

class FormatBuilder : Expression.Builder
FormatSectionBuilder
Link copied to clipboard

Builder for a Formatted Section.

class FormatSectionBuilder(content: Expression)
InterpolatorBuilder
Link copied to clipboard

Builder for Interpolate Expression.

class InterpolatorBuilder(operator: String) : Expression.ExpressionBuilder
NumberFormatBuilder
Link copied to clipboard

Builder for Number Format expression.

class NumberFormatBuilder(input: Expression) : Expression.Builder

Functions

buildJson
Link copied to clipboard
open override fun buildJson(p0: JsonWriter)
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
getContents
Link copied to clipboard
open override fun getContents(): Any?
getLiteral
Link copied to clipboard

Get the literal value of the expression as given type.

Return null if expression is not literal or can not be casted to given type.

inline fun <T> getLiteral(): T?
hashCode
Link copied to clipboard
open override fun hashCode(): Int
isLiteral
Link copied to clipboard

Check if the expression is literal.

fun isLiteral(): Boolean
toJson
Link copied to clipboard
open override fun toJson(): String
toString
Link copied to clipboard
open override fun toString(): String

Properties

contents
Link copied to clipboard
override val contents: Any?
literalValue
Link copied to clipboard

Return Expression as literal Value.

Return null if the expression is not literal.

var literalValue: Any?