summaryrefslogtreecommitdiff
path: root/platform/darwin/src/NSExpression+MGLAdditions.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/NSExpression+MGLAdditions.mm')
-rw-r--r--platform/darwin/src/NSExpression+MGLAdditions.mm10
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/darwin/src/NSExpression+MGLAdditions.mm b/platform/darwin/src/NSExpression+MGLAdditions.mm
index 54f98c6ab9..9238a291a4 100644
--- a/platform/darwin/src/NSExpression+MGLAdditions.mm
+++ b/platform/darwin/src/NSExpression+MGLAdditions.mm
@@ -68,6 +68,7 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier =
INSTALL_METHOD(mgl_step:from:stops:);
INSTALL_METHOD(mgl_coalesce:);
INSTALL_METHOD(mgl_does:have:);
+ INSTALL_METHOD(mgl_acos:);
// Install functions that resemble control structures, taking arbitrary
// numbers of arguments. Vararg aftermarket functions need to be declared
@@ -98,6 +99,13 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier =
}
/**
+ Computes the principal value of the arc cosine of number.
+ */
+- (NSNumber *)mgl_acos:(NSNumber *)number {
+ return @(acos(number.doubleValue));
+}
+
+/**
A placeholder for a method that evaluates an interpolation expression.
*/
- (id)mgl_interpolate:(id)inputExpression withCurveType:(NSString *)curveType parameters:(NSDictionary *)params stops:(NSDictionary *)stops {
@@ -675,6 +683,7 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) {
@"ln": @"ln:",
@"abs": @"abs:",
@"round": @"mgl_round:",
+ @"acos" : @"mgl_acos:",
@"floor": @"floor:",
@"ceil": @"ceiling:",
@"^": @"raise:toPower:",
@@ -917,6 +926,7 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) {
@"lowercase:": @"downcase",
@"length:": @"length",
@"mgl_round:": @"round",
+ @"mgl_acos:" : @"acos",
// Vararg aftermarket expressions need to be declared with an explicit and implicit first argument.
@"MGL_LET": @"let",
@"MGL_LET:": @"let",