mapbox-maps-ios
mapbox-maps-ios copied to clipboard
Update GeoJSONSource.clusterProperties to support [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]
New Feature
I would like to be able to use GeoJSONSource.clusterProperties with Operator.accumulated.
Why
In order to express [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]] and other such expressions, the type for the value of the clusterProperties dictionary must support an array of two expressions.
I believe this can be accomplished by adding another Operator called expression with associated value of type Expression. This will require removing String raw type from the enum. Custom encoder/decoder function/init will need to be added as well.
Another possible solution is to change the type of clusterProperties to [String: [Expression.Element]]. This simple solution is less type safe but much easier to implement. It would be nice to make Expression.elements public if this route is taken.
@ZiZasaurus is there a way to express [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]] with the current state of the iOS mapbox SDK? I can't seem to figure out a way to do it.
re-opened as a bug https://github.com/mapbox/mapbox-maps-ios/issues/1571