diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2018-03-29 10:25:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-29 10:25:05 -0700 |
commit | 8c5eb6ca9cbb26778c7ad2ce58c2d673d6170300 (patch) | |
tree | a3c8ee8511eb2a91e9b91e381c58c5e0e1d7abe7 /platform/ios/app | |
parent | e5a3a7a4510bbbf2fc97363ab0084fb4bc3dd448 (diff) | |
download | qtlocation-mapboxgl-8c5eb6ca9cbb26778c7ad2ce58c2d673d6170300.tar.gz |
Install aftermarket expression functions (#11472)
* [ios, macos] Introduced more ergonomic expression concatenation syntax
* [ios, macos] Fixed mgl_join:
* [ios, macos] Simplified expression document headings
* [ios, macos] Documented mgl_join:
* [ios, macos] Convert length operator to length: for strings
Only works for literal strings.
* [ios, macos] Implemented type conversion using CAST()
* [ios, macos] Aftermarket let expressions
* [ios, macos] Refactored aftermarket expression functions
Refactored the installation of aftermarket expression functions to use macros. It is no longer necessary to handwrite the type encoding of a function. Also added aftermarket functions for interpolating and stepping.
* [ios, macos] Updated documentation, tests, demo apps
* [ios, macos] Added generic expression function
* [ios, macos] Add MGL_MATCH function placeholder.
* [ios, macos] Add MGL_SWITCH expression operator.
* [ios, macos] Add mgl_coalesce: as expression function.
* [ios, macos] Update style documentation.
* [ios, macos] Add conventional custom function support.
* [ios, macos] Updated example code
* [ios, macos] Add mgl_coalesce conventional custom function support.
* [ios, macos] Add aftermarket function to 'has' operator.
* [ios, macos] Add documentation for lookup and feature operators.
* [ios, macos] Documented simple lookup
* [ios, macos] Renamed, reversed has expression
Renamed mgl_hasProperty:properties: to mgl_does:have: for better readability and consistency with the conventional mgl_has: function. Documented both forms of mgl_has:.
* [ios, macos] Restored OEM conditionals where available
This is the preferred syntax for simple conditionals on iOS 9 and above, because you can inline the predicate instead of wrapping it in a constant value expression, which means you can write a conditional in a single format string.
* [ios, macos] Update style docs.
Co-authored-by: Fabian Guerra <fabian.guerra@mapbox.com>
Diffstat (limited to 'platform/ios/app')
-rw-r--r-- | platform/ios/app/MBXViewController.m | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 5282469223..2a6708a69f 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -969,7 +969,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { @12.0f: [UIColor greenColor], @14.0f: [UIColor blueColor]}; waterLayer.fillColor = [NSExpression expressionWithFormat: - @"FUNCTION($zoomLevel, 'mgl_interpolateWithCurveType:parameters:stops:', 'linear', nil, %@)", + @"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", waterColorStops]; NSDictionary *fillAntialiasedStops = @{@11: @YES, @@ -978,7 +978,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { @14: @NO, @15: @YES}; waterLayer.fillAntialiased = [NSExpression expressionWithFormat: - @"FUNCTION($zoomLevel, 'mgl_stepWithMinimum:stops:', false, %@)", + @"mgl_step:from:stops:($zoomLevel, false, %@)", fillAntialiasedStops]; } @@ -991,7 +991,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { @10: @15, @15: @30}; NSExpression *lineWidthExpression = [NSExpression expressionWithFormat: - @"FUNCTION($zoomLevel, 'mgl_interpolateWithCurveType:parameters:stops:', 'linear', nil, %@)", + @"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", lineWidthStops]; roadLayer.lineWidth = lineWidthExpression; roadLayer.lineGapWidth = lineWidthExpression; @@ -1000,7 +1000,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { @13: [UIColor yellowColor], @16: [UIColor cyanColor]}; roadLayer.lineColor = [NSExpression expressionWithFormat: - @"FUNCTION($zoomLevel, 'mgl_interpolateWithCurveType:parameters:stops:', 'linear', nil, %@)", + @"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", roadLineColorStops]; roadLayer.visible = YES; @@ -1018,7 +1018,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { NSDictionary *opacityStops = @{@20.0f: @1.0f, @5.0f: @0.0f}; rasterLayer.rasterOpacity = [NSExpression expressionWithFormat: - @"FUNCTION($zoomLevel, 'mgl_interpolateWithCurveType:parameters:stops:', 'linear', nil, %@)", + @"mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", opacityStops]; [self.mapView.style addLayer:rasterLayer]; } |