[ios, macos] Rename featureProperties to featureAttributes. (#11748)

* [ios, macos] Rename featureProperties to featureAttributes.

* [ios, macos] Update style documentation.

* [ios, macos] Remove featureProperties variable tests.

* [ios, macos] Update the changelogs.
This commit is contained in:
Fabian Guerra Soto
2018-04-23 09:05:36 -04:00
committed by GitHub
parent 991264ae65
commit a45670cfb5
9 changed files with 29 additions and 11 deletions

View File

@@ -341,7 +341,7 @@ In style specification | Method, function, or predicate type | Format string syn
`typeof` | |
`geometry-type` | `NSExpression.geometryTypeVariableExpression` | `$geometryType`
`id` | `NSExpression.featureIdentifierVariableExpression` | `$featureIdentifier`
`properties` | `NSExpression.featurePropertiesVariableExpression` | `$featureProperties`
`properties` | `NSExpression.featureAttributesVariableExpression` | `$featureAttributes`
`at` | `objectFrom:withIndex:` | `array[n]`
`get` | `+[NSExpression expressionForKeyPath:]` | Key path
`has` | `mgl_does:have:` | `mgl_does:have:(self, 'key')`

View File

@@ -630,7 +630,7 @@ otherwise <code>TRUE</code>.
<dt>Selector:</dt>
<dd><code>mgl_has:</code></dd>
<dt>Format string syntax:</dt>
<dd><code>FUNCTION($featureProperties, 'mgl_has:', '🧀🍔')</code></dd>
<dd><code>FUNCTION($featureAttributes, 'mgl_has:', '🧀🍔')</code></dd>
<dt>Target:</dt>
<dd>
An <code>NSExpression</code> that evaluates to an <code>NSDictionary</code>

View File

@@ -80,7 +80,9 @@ extern MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionInterpolatio
<a href="https://www.mapbox.com/mapbox-gl-js/style-spec/#expressions-properties"><code>properties</code></a>
expression operator in the Mapbox Style Specification.
*/
@property (class, nonatomic, readonly) NSExpression *featurePropertiesVariableExpression;
@property (class, nonatomic, readonly) NSExpression *featureAttributesVariableExpression;
@property (class, nonatomic, readonly) NSExpression *featurePropertiesVariableExpression __attribute__((deprecated("Use -featureAttributesVariableExpression.")));
#pragma mark Creating Conditional Expressions

View File

@@ -656,8 +656,12 @@ NS_DICTIONARY_OF(NSNumber *, NSExpression *) *MGLStopDictionaryByReplacingTokens
return [NSExpression expressionForVariable:@"featureIdentifier"];
}
+ (NSExpression *)featureAttributesVariableExpression {
return [NSExpression expressionForVariable:@"featureAttributes"];
}
+ (NSExpression *)featurePropertiesVariableExpression {
return [NSExpression expressionForVariable:@"featureProperties"];
return [self featureAttributesVariableExpression];
}
+ (instancetype)mgl_expressionForConditional:(nonnull NSPredicate *)conditionPredicate trueExpression:(nonnull NSExpression *)trueExpression falseExpresssion:(nonnull NSExpression *)falseExpression {
@@ -901,7 +905,7 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) {
} else if ([op isEqualToString:@"id"]) {
return NSExpression.featureIdentifierVariableExpression;
} else if ([op isEqualToString:@"properties"]) {
return NSExpression.featurePropertiesVariableExpression;
return NSExpression.featureAttributesVariableExpression;
} else if ([op isEqualToString:@"var"]) {
return [NSExpression expressionForVariable:argumentObjects.firstObject];
} else if ([op isEqualToString:@"case"]) {
@@ -1000,7 +1004,7 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) {
if ([self.variable isEqualToString:@"featureIdentifier"]) {
return @[@"id"];
}
if ([self.variable isEqualToString:@"featureProperties"]) {
if ([self.variable isEqualToString:@"featureAttributes"]) {
return @[@"properties"];
}
return @[@"var", self.variable];

View File

@@ -183,9 +183,9 @@ using namespace std::string_literals;
XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:@[@"id"]], expression);
}
{
NSExpression *expression = [NSExpression expressionForVariable:@"featureProperties"];
NSExpression *expression = [NSExpression expressionForVariable:@"featureAttributes"];
XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, @[@"properties"]);
XCTAssertEqualObjects([NSExpression expressionWithFormat:@"$featureProperties"].mgl_jsonExpressionObject, @[@"properties"]);
XCTAssertEqualObjects([NSExpression expressionWithFormat:@"$featureAttributes"].mgl_jsonExpressionObject, @[@"properties"]);
XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:@[@"properties"]], expression);
}
{
@@ -867,7 +867,7 @@ using namespace std::string_literals;
}
{
NSExpression *expression = [NSExpression expressionForFunction:@"mgl_does:have:"
arguments:@[[NSExpression expressionForVariable:@"featureProperties"],
arguments:@[[NSExpression expressionForVariable:@"featureAttributes"],
[NSExpression expressionForConstantValue:@"x"]]];
NSArray *jsonExpression = @[@"has", @"x", @[@"properties"]];
XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression);

View File

@@ -2,6 +2,12 @@
Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started.
## 4.0.1
### Style layers
* Deprecated `+[NSExpression featurePropertiesVariableExpression]` use `+[NSExpression featureAttributesVariableExpression]` instead. ([#11748](https://github.com/mapbox/mapbox-gl-native/pull/11748))
## 4.0.0 - April 19, 2018
The 4.0._x_ series of releases will be the last to support iOS 8. The minimum iOS deployment version will increase to iOS 9.0 in a future release.

View File

@@ -331,7 +331,7 @@ In style specification | Method, function, or predicate type | Format string syn
`typeof` | |
`geometry-type` | `NSExpression.geometryTypeVariableExpression` | `$geometryType`
`id` | `NSExpression.featureIdentifierVariableExpression` | `$featureIdentifier`
`properties` | `NSExpression.featurePropertiesVariableExpression` | `$featureProperties`
`properties` | `NSExpression.featureAttributesVariableExpression` | `$featureAttributes`
`at` | `objectFrom:withIndex:` | `array[n]`
`get` | `+[NSExpression expressionForKeyPath:]` | Key path
`has` | `mgl_does:have:` | `mgl_does:have:(self, 'key')`

View File

@@ -1,5 +1,11 @@
# Changelog for Mapbox Maps SDK for macOS
## 0.7.1
### Style layers
* Deprecated `+[NSExpression featurePropertiesVariableExpression]` use `+[NSExpression featureAttributesVariableExpression]` instead. ([#11748](https://github.com/mapbox/mapbox-gl-native/pull/11748))
## 0.7.0 - April 19, 2018
The 0.7._x_ series of releases will be the last to support macOS 10.10. The minimum macOS deployment version will increase to macOS 10.11.0 in a future release.

View File

@@ -324,7 +324,7 @@ In style specification | Method, function, or predicate type | Format string syn
`typeof` | |
`geometry-type` | `NSExpression.geometryTypeVariableExpression` | `$geometryType`
`id` | `NSExpression.featureIdentifierVariableExpression` | `$featureIdentifier`
`properties` | `NSExpression.featurePropertiesVariableExpression` | `$featureProperties`
`properties` | `NSExpression.featureAttributesVariableExpression` | `$featureAttributes`
`at` | `objectFrom:withIndex:` | `array[n]`
`get` | `+[NSExpression expressionForKeyPath:]` | Key path
`has` | `mgl_does:have:` | `mgl_does:have:(self, 'key')`