diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2018-10-25 04:57:08 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2018-10-30 14:26:59 -0700 |
commit | 3f314682fa2f2701c0d1c7e863013ce254a23afd (patch) | |
tree | ea1a88fa8aad86a42372c65d17b6472de8f3f071 /platform/darwin/src | |
parent | a0ebd61929bbfc16572b10fa9facb65384ce78ed (diff) | |
download | qtlocation-mapboxgl-3f314682fa2f2701c0d1c7e863013ce254a23afd.tar.gz |
[ios, macos] Added $lineProgress expression variable
Diffstat (limited to 'platform/darwin/src')
-rw-r--r-- | platform/darwin/src/NSExpression+MGLAdditions.h | 7 | ||||
-rw-r--r-- | platform/darwin/src/NSExpression+MGLAdditions.mm | 9 |
2 files changed, 16 insertions, 0 deletions
diff --git a/platform/darwin/src/NSExpression+MGLAdditions.h b/platform/darwin/src/NSExpression+MGLAdditions.h index d13f0227b4..9ee7361448 100644 --- a/platform/darwin/src/NSExpression+MGLAdditions.h +++ b/platform/darwin/src/NSExpression+MGLAdditions.h @@ -63,6 +63,13 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI /** `NSExpression` variable that corresponds to the + <a href="https://www.mapbox.com/mapbox-gl-js/style-spec/#expressions-line-progress"><code>line-progress</code></a> + expression operator in the Mapbox Style Specification. + */ +@property (class, nonatomic, readonly) NSExpression *lineProgressVariableExpression; + +/** + `NSExpression` variable that corresponds to the <a href="https://www.mapbox.com/mapbox-gl-js/style-spec/#eexpressions-geometry-type"><code>geometry-type</code></a> expression operator in the Mapbox Style Specification. */ diff --git a/platform/darwin/src/NSExpression+MGLAdditions.mm b/platform/darwin/src/NSExpression+MGLAdditions.mm index cb7f30f65a..9c12c6beac 100644 --- a/platform/darwin/src/NSExpression+MGLAdditions.mm +++ b/platform/darwin/src/NSExpression+MGLAdditions.mm @@ -542,6 +542,10 @@ const MGLExpressionInterpolationMode MGLExpressionInterpolationModeCubicBezier = return [NSExpression expressionForVariable:@"heatmapDensity"]; } ++ (NSExpression *)lineProgressVariableExpression { + return [NSExpression expressionForVariable:@"lineProgress"]; +} + + (NSExpression *)geometryTypeVariableExpression { return [NSExpression expressionForVariable:@"geometryType"]; } @@ -814,6 +818,8 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { return NSExpression.zoomLevelVariableExpression; } else if ([op isEqualToString:@"heatmap-density"]) { return NSExpression.heatmapDensityVariableExpression; + } else if ([op isEqualToString:@"line-progress"]) { + return NSExpression.lineProgressVariableExpression; } else if ([op isEqualToString:@"geometry-type"]) { return NSExpression.geometryTypeVariableExpression; } else if ([op isEqualToString:@"id"]) { @@ -911,6 +917,9 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { if ([self.variable isEqualToString:@"heatmapDensity"]) { return @[@"heatmap-density"]; } + if ([self.variable isEqualToString:@"lineProgress"]) { + return @[@"line-progress"]; + } if ([self.variable isEqualToString:@"zoomLevel"]) { return @[@"zoom"]; } |