Expression

public struct Expression : Codable, CustomStringConvertible, Equatable

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.

  • The operator of this expression If the expression starts with an argument instead of an operator then return the first operator of a contained expression if available.

    Declaration

    Swift

    public var `operator`: Operator { get }
  • The arguments contained in this expression

    Declaration

    Swift

    public var arguments: [Argument] { get }
  • Undocumented

    Declaration

    Swift

    public init(_ op: Operator,
                @ExpressionArgumentBuilder content: () -> [Expression.Argument])
  • Create an operator-only expression.

    Declaration

    Swift

    public init(_ op: Operator)
  • Initialize an expression with an operator and arguments

    Declaration

    Swift

    public init(operator op: Operator, arguments: [Argument])
  • Initialize an expression with only arguments

    Declaration

    Swift

    public init(@ExpressionArgumentBuilder content: () -> [Expression.Argument])
  • Initialize an expression with only arguments

    Declaration

    Swift

    public init(arguments: [Argument])
  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws
  • Declaration

    Swift

    public var description: String { get }
  • Declaration

    Swift

    public init(from decoder: Decoder) throws
  • An ExpressionElement can be either a op (associated with a String) OR an argument (associated with an ExpressionArgument)

    See more

    Declaration

    Swift

    public indirect enum Element : Codable, CustomStringConvertible, Equatable
  • An ExpressionArgument is either a literal (associated with a double, string, boolean, or null value) or another Expression

    See more

    Declaration

    Swift

    public indirect enum Argument : Codable, CustomStringConvertible, Equatable
  • Undocumented

    See more

    Declaration

    Swift

    enum Operator : String, Codable, CaseIterable
  • Undocumented

    See more

    Declaration

    Swift

    public enum Option : Codable, Equatable