Open anandthakker opened 6 years ago
All the relevant functions from
NSExpression
Inspired by this issue, I attempted to compile a similar issue to track feature parity with NSPredicate and NSExpression: mapbox/mapbox-gl-native#11786.
Hi, I have not found
Oh, I didn't know about this ticket!
Me, I would love more string-handling functions:
Oh, I didn't know about this ticket!
Me, I would love more string-handling functions:
- left
- right
- split
- titlecase (yes I know it's difficult to do in a locale-independent way)
@stevage, just letting you know that my PR #9450 was merged in and soon you will have slice
which you can use on strings to do left/right/mid. Check out #9443 to see some examples.
It's not perfect but if you had just a single word you could always slice the first letter and uppercase it and concat with the remainder of the string, something like the below (untested!)
['concat', ['upcase', ['slice', ['get','attributeToTitleCase'], 0 ,1]], ['downcase', ['slice', ['get','attributeToTitleCase'], 1]]]
@mourner We extended mapbox-gl with a few basic date functions (new datetype, epoch: int -> date, hour and minute to get those values from a date value). Those are obviously pretty specific for our use case, but I could dedicate time to implement a more general date API.
My questions would be:
This ticket is intended to define what set of operators would constitute a "complete" expression API and track its implementation.
Math.*
functions from JavascriptNSExpression
is-nan
https://github.com/mapbox/mapbox-gl-js/issues/5494