diff options
author | Fabian Guerra Soto <fabian.guerra@mapbox.com> | 2019-03-15 16:10:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-15 16:10:27 -0700 |
commit | 7939ff213a98de055e93ddd893ccae40b82a7d16 (patch) | |
tree | f23371b62e4ce1e4964361a04c0b11a39ede8569 /platform/macos | |
parent | c8cfdb1ced822711e772dfcc8f708b1a7a68b5fc (diff) | |
download | qtlocation-mapboxgl-7939ff213a98de055e93ddd893ccae40b82a7d16.tar.gz |
[ios, macos] Add format expression convenience methods support. (#14094)
Added the ios/macos format expression bindings.
The equivalent is mgl_attributed: or mgl_attributed({}) when making an expression using the expressionForFormat selector.
A new constructor called mgl_expressionForAttributedExpressions:(NSArray<NSExpression*>*)attributedExpressions was added to NSExpression+MGLAdditions category.
Updated the symbol style layer text test to use the bindings.
Updated the Predicates and Expressions.md and For Style Authors.md.ejs template with the bindings.
Diffstat (limited to 'platform/macos')
-rw-r--r-- | platform/macos/CHANGELOG.md | 1 | ||||
-rw-r--r-- | platform/macos/docs/guides/For Style Authors.md | 1 | ||||
-rw-r--r-- | platform/macos/macos.xcodeproj/project.pbxproj | 8 | ||||
-rw-r--r-- | platform/macos/sdk-files.json | 2 | ||||
-rw-r--r-- | platform/macos/src/Mapbox.h | 1 |
5 files changed, 13 insertions, 0 deletions
diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index ba3f00a5d6..2542f57d95 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -9,6 +9,7 @@ * Added the `-[MGLShapeSource leavesOfCluster:offset:limit:]`, `-[MGLShapeSource childrenOfCluster:]`, `-[MGLShapeSource zoomLevelForExpandingCluster:]` methods for inspecting a cluster in an `MGLShapeSource`s created with the `MGLShapeSourceOptionClustered` option. Feature querying now returns clusters represented by `MGLPointFeatureCluster` objects (that conform to the `MGLCluster` protocol). ([#12952](https://github.com/mapbox/mapbox-gl-native/pull/12952) * Added `MGLNetworkConfiguration` class to customize the SDK's `NSURLSessionConfiguration` object. ([#11447](https://github.com/mapbox/mapbox-gl-native/pull/13886)) * Fixed an issue that caused `MGL_FUNCTION` to ignore multiple formatting parameters when passed a `format` function as parameter. ([#14064](https://github.com/mapbox/mapbox-gl-native/pull/14064)) +* Added `mgl_attributed:` expression operator, which concatenate `MGLAttributedExpression` objects for specifying rich text in the `MGLSymbolStyleLayer.text` property. ([#14094](https://github.com/mapbox/mapbox-gl-native/pull/14094)) ### Annotations diff --git a/platform/macos/docs/guides/For Style Authors.md b/platform/macos/docs/guides/For Style Authors.md index fdba68879c..038ddf1f93 100644 --- a/platform/macos/docs/guides/For Style Authors.md +++ b/platform/macos/docs/guides/For Style Authors.md @@ -383,6 +383,7 @@ In style specification | Method, function, or predicate type | Format string syn `zoom` | `NSExpression.zoomLevelVariableExpression` | `$zoomLevel` `heatmap-density` | `NSExpression.heatmapDensityVariableExpression` | `$heatmapDensity` `line-progress` | `NSExpression.lineProgressVariableExpression` | `$lineProgress` +`format` | `+[NSExpression mgl_expressionForAttributedExpressions:]` or `mgl_attributed:` | `mgl_attributed({x, y, z})` For operators that have no corresponding `NSExpression` symbol, use the `MGL_FUNCTION()` format string syntax. diff --git a/platform/macos/macos.xcodeproj/project.pbxproj b/platform/macos/macos.xcodeproj/project.pbxproj index 739a388e6e..5d5a94c78a 100644 --- a/platform/macos/macos.xcodeproj/project.pbxproj +++ b/platform/macos/macos.xcodeproj/project.pbxproj @@ -29,6 +29,8 @@ 1F95931B1E6DE2B600D5B294 /* MGLNSDateAdditionsTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F95931A1E6DE2B600D5B294 /* MGLNSDateAdditionsTests.mm */; }; 1F9EF4061FBA1B0E0063FBB0 /* mapbox_helmet.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 1F9EF4051FBA1B0D0063FBB0 /* mapbox_helmet.pdf */; }; 1FC481852098F323000D09B4 /* NSPredicate+MGLPrivateAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FC481842098F323000D09B4 /* NSPredicate+MGLPrivateAdditions.h */; }; + 1FF4858D2237235300F19727 /* MGLAttributedExpression.m in Sources */ = {isa = PBXBuildFile; fileRef = 1FF4858B2237235200F19727 /* MGLAttributedExpression.m */; }; + 1FF4858E2237235300F19727 /* MGLAttributedExpression.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FF4858C2237235200F19727 /* MGLAttributedExpression.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3508EC641D749D39009B0EE4 /* NSExpression+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3508EC621D749D39009B0EE4 /* NSExpression+MGLAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3508EC651D749D39009B0EE4 /* NSExpression+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3508EC631D749D39009B0EE4 /* NSExpression+MGLAdditions.mm */; }; 3526EABD1DF9B19800006B43 /* MGLCodingTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3526EABC1DF9B19800006B43 /* MGLCodingTests.mm */; }; @@ -343,6 +345,8 @@ 1FC481842098F323000D09B4 /* NSPredicate+MGLPrivateAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSPredicate+MGLPrivateAdditions.h"; sourceTree = "<group>"; }; 1FDB00CC21F8F1FD00D21389 /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/Localizable.strings; sourceTree = "<group>"; }; 1FDB00CD21F8F1FF00D21389 /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/Localizable.strings; sourceTree = "<group>"; }; + 1FF4858B2237235200F19727 /* MGLAttributedExpression.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLAttributedExpression.m; sourceTree = "<group>"; }; + 1FF4858C2237235200F19727 /* MGLAttributedExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAttributedExpression.h; sourceTree = "<group>"; }; 3508EC621D749D39009B0EE4 /* NSExpression+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSExpression+MGLAdditions.h"; sourceTree = "<group>"; }; 3508EC631D749D39009B0EE4 /* NSExpression+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSExpression+MGLAdditions.mm"; sourceTree = "<group>"; }; 3526EABC1DF9B19800006B43 /* MGLCodingTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLCodingTests.mm; path = ../../darwin/test/MGLCodingTests.mm; sourceTree = "<group>"; }; @@ -1204,6 +1208,8 @@ DA00FC881D5EEAC3009AABC8 /* MGLAttributionInfo.h */, DAF0D8151DFE6B1800B28378 /* MGLAttributionInfo_Private.h */, DA00FC891D5EEAC3009AABC8 /* MGLAttributionInfo.mm */, + 1FF4858C2237235200F19727 /* MGLAttributedExpression.h */, + 1FF4858B2237235200F19727 /* MGLAttributedExpression.m */, 556660C51E1BEA0100E2C41B /* MGLFoundation.h */, 558DE7A41E56161C00C7916D /* MGLFoundation_Private.h */, 558DE7A51E56161C00C7916D /* MGLFoundation.mm */, @@ -1276,6 +1282,7 @@ DAE6C38D1CC31E2A00DB3429 /* MGLOfflineRegion_Private.h in Headers */, DA7DC9831DED647F0027472F /* MGLRasterTileSource_Private.h in Headers */, 747ABE5B219B2BDB00523B67 /* MGLBackgroundStyleLayer_Private.h in Headers */, + 1FF4858E2237235300F19727 /* MGLAttributedExpression.h in Headers */, 1753ED401E53CE6100A9FD90 /* MGLConversion.h in Headers */, 747ABE59219B2BDB00523B67 /* MGLFillExtrusionStyleLayer_Private.h in Headers */, DA8F259C1D51CB000010E6B5 /* MGLStyleValue_Private.h in Headers */, @@ -1653,6 +1660,7 @@ 352742821D4C243B00A1ECE6 /* MGLSource.mm in Sources */, DAE6C3881CC31E2A00DB3429 /* MGLMapCamera.mm in Sources */, DA6408D81DA4E5DA00908C90 /* MGLVectorStyleLayer.m in Sources */, + 1FF4858D2237235300F19727 /* MGLAttributedExpression.m in Sources */, DA8F25B31D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.mm in Sources */, DAE6C3911CC31E2A00DB3429 /* MGLPolygon.mm in Sources */, 35C6DF851E214C0400ACA483 /* MGLDistanceFormatter.m in Sources */, diff --git a/platform/macos/sdk-files.json b/platform/macos/sdk-files.json index 3c728ad37d..25987a5a0e 100644 --- a/platform/macos/sdk-files.json +++ b/platform/macos/sdk-files.json @@ -47,6 +47,7 @@ "platform/darwin/src/MGLSource.mm", "platform/darwin/src/MGLMapCamera.mm", "platform/darwin/src/MGLVectorStyleLayer.m", + "platform/darwin/src/MGLAttributedExpression.m", "platform/darwin/src/NSValue+MGLStyleAttributeAdditions.mm", "platform/darwin/src/MGLPolygon.mm", "platform/darwin/src/MGLDistanceFormatter.m", @@ -80,6 +81,7 @@ "MGLComputedShapeSource.h": "platform/darwin/src/MGLComputedShapeSource.h", "MGLRasterStyleLayer.h": "platform/darwin/src/MGLRasterStyleLayer.h", "NSExpression+MGLAdditions.h": "platform/darwin/src/NSExpression+MGLAdditions.h", + "MGLAttributedExpression.h": "platform/darwin/src/MGLAttributedExpression.h", "MGLAnnotation.h": "platform/darwin/src/MGLAnnotation.h", "MGLHillshadeStyleLayer.h": "platform/darwin/src/MGLHillshadeStyleLayer.h", "MGLMapSnapshotter.h": "platform/darwin/src/MGLMapSnapshotter.h", diff --git a/platform/macos/src/Mapbox.h b/platform/macos/src/Mapbox.h index 4d54c753df..a11867657d 100644 --- a/platform/macos/src/Mapbox.h +++ b/platform/macos/src/Mapbox.h @@ -67,3 +67,4 @@ FOUNDATION_EXPORT MGL_EXPORT const unsigned char MapboxVersionString[]; #import "NSPredicate+MGLAdditions.h" #import "MGLLoggingConfiguration.h" #import "MGLNetworkConfiguration.h" +#import "MGLAttributedExpression.h" |