Skip to content

Plus with more than two expressions #146

@rafraser

Description

@rafraser

Hi all - I've run up against a minor wall and I was hoping to get some insight.

According to the Mapbox docs for the + expression, it can sum more than two arguments. https://docs.mapbox.com/mapbox-gl-js/style-spec/expressions/#+

["+", number, number, ...]: number

However, the plus operator in this library only takes in two arguments. I was really hoping to get this working with arbitrary lists.

Looking at the source for this library, it doesn't seem too difficult to write, eg:

plusMany : List (Expression exprType Float) -> Expression exprType Float
plusMany =
    calln "+"

However, calln isn't exposed so I'm unable to write this in my own projects! Any other potential solutions to this that I'm missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions