summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Guerra <fabian.guerra@mapbox.com>2018-03-28 21:39:54 -0400
committerFabian Guerra <fabian.guerra@mapbox.com>2018-03-28 21:39:54 -0400
commita51ae903e8072e732bad2a63fc142ab4bbb5caf2 (patch)
tree11f9defecab1577aa5282e0f174d10041fb4147b
parent0a9b7a0d74fa0768c314ed0f0bcc3d4d4f796bcb (diff)
downloadqtlocation-mapboxgl-a51ae903e8072e732bad2a63fc142ab4bbb5caf2.tar.gz
[ios, macos] Add documentation for lookup and feature operators.
-rw-r--r--platform/darwin/docs/guides/For Style Authors.md.ejs10
-rw-r--r--platform/darwin/docs/guides/Predicates and Expressions.md1
-rw-r--r--platform/darwin/src/NSExpression+MGLAdditions.mm2
-rw-r--r--platform/ios/docs/guides/For Style Authors.md10
-rw-r--r--platform/macos/docs/guides/For Style Authors.md10
5 files changed, 17 insertions, 16 deletions
diff --git a/platform/darwin/docs/guides/For Style Authors.md.ejs b/platform/darwin/docs/guides/For Style Authors.md.ejs
index 7306862874..ecd1f6af41 100644
--- a/platform/darwin/docs/guides/For Style Authors.md.ejs
+++ b/platform/darwin/docs/guides/For Style Authors.md.ejs
@@ -338,12 +338,12 @@ In style specification | Method, function, or predicate type | Format string syn
`to-number` | `mgl_numberWithFallbackValues:` | `CAST(zipCode, 'NSNumber')`
`to-string` | `stringValue` | `CAST(ele, 'NSString')`
`typeof` | |
-`geometry-type` | |
-`id` | |
-`properties` | |
-`at` | |
+`geometry-type` | |`$mgl_geometryType`
+`id` | |`$mgl_featureIdentifier`
+`properties` | |`$mgl_featureProperties`
+`at` | `objectFrom:withIndex:` |
`get` | `+[NSExpression expressionForKeyPath:]` | Key path
-`has` | |
+`has` | `mgl_hasProperty:properties:` |
`length` | `count:` | `count({1, 2, 2, 3, 4, 7, 9})`
`!` | `NSNotPredicateType` | `NOT (p0 OR … OR pn)`
`!=` | `NSNotEqualToPredicateOperatorType` | `key != value`
diff --git a/platform/darwin/docs/guides/Predicates and Expressions.md b/platform/darwin/docs/guides/Predicates and Expressions.md
index caf4226cfd..27c7c4cd8d 100644
--- a/platform/darwin/docs/guides/Predicates and Expressions.md
+++ b/platform/darwin/docs/guides/Predicates and Expressions.md
@@ -199,6 +199,7 @@ Initializer parameter | Format string syntax | Description
`MGL_LET` | `MGL_LET('age', uppercase('old'), 'name', uppercase('MacDonald'), mgl_join({$age, $name}))` | Any number of variable names interspersed with their assigned `NSExpression` values, followed by an `NSExpression` that may contain references to those variables. Compared to the `mgl_expressionWithContext:` custom function, this function takes the variable names and values inline before the expression that contains references to those variables.
`MGL_MATCH` | `MGL_MATCH(x, 0, 'zero match', 1, 'one match', 'two match', 'default')` | Evaluates the first expression and returns the value that matches the initial condition. After the first expression condition a pair of matching/return value should be added and a default value.
`MGL_IF` | `MGL_IF(1 = 2, YES, 2 = 2, YES, NO)` | Returns the first value that meets the condition otherwise a default value. The expression conditions should be added in pairs of conditional/return value.
+`mgl_hasProperty:properties:` | `mgl_hasProperty:properties:('x', {'x': 'value'})` | Evaluates the expression and returns true if the properties contains the passed property.
The following custom functions are also available with the
`+[NSExpression expressionForFunction:selectorName:arguments:]` method or the
diff --git a/platform/darwin/src/NSExpression+MGLAdditions.mm b/platform/darwin/src/NSExpression+MGLAdditions.mm
index a5676529fc..46e976f032 100644
--- a/platform/darwin/src/NSExpression+MGLAdditions.mm
+++ b/platform/darwin/src/NSExpression+MGLAdditions.mm
@@ -111,7 +111,7 @@
}
/**
- A placeholder for a method that evaluates a coalesce expression.
+ A placeholder for a method that evaluates has expression.
*/
- (id)mgl_hasProperty:(id)element properties:(id)properties {
[NSException raise:NSInvalidArgumentException
diff --git a/platform/ios/docs/guides/For Style Authors.md b/platform/ios/docs/guides/For Style Authors.md
index 9f02835fd1..ce9a68032e 100644
--- a/platform/ios/docs/guides/For Style Authors.md
+++ b/platform/ios/docs/guides/For Style Authors.md
@@ -328,12 +328,12 @@ In style specification | Method, function, or predicate type | Format string syn
`to-number` | `mgl_numberWithFallbackValues:` | `CAST(zipCode, 'NSNumber')`
`to-string` | `stringValue` | `CAST(ele, 'NSString')`
`typeof` | |
-`geometry-type` | |
-`id` | |
-`properties` | |
-`at` | |
+`geometry-type` | |`$mgl_geometryType`
+`id` | |`$mgl_featureIdentifier`
+`properties` | |`$mgl_featureProperties`
+`at` | `objectFrom:withIndex:` |
`get` | `+[NSExpression expressionForKeyPath:]` | Key path
-`has` | |
+`has` | `mgl_hasProperty:properties:` |
`length` | `count:` | `count({1, 2, 2, 3, 4, 7, 9})`
`!` | `NSNotPredicateType` | `NOT (p0 OR … OR pn)`
`!=` | `NSNotEqualToPredicateOperatorType` | `key != value`
diff --git a/platform/macos/docs/guides/For Style Authors.md b/platform/macos/docs/guides/For Style Authors.md
index 0c8e5717b8..a67cf3898f 100644
--- a/platform/macos/docs/guides/For Style Authors.md
+++ b/platform/macos/docs/guides/For Style Authors.md
@@ -321,12 +321,12 @@ In style specification | Method, function, or predicate type | Format string syn
`to-number` | `mgl_numberWithFallbackValues:` | `CAST(zipCode, 'NSNumber')`
`to-string` | `stringValue` | `CAST(ele, 'NSString')`
`typeof` | |
-`geometry-type` | |
-`id` | |
-`properties` | |
-`at` | |
+`geometry-type` | |`$mgl_geometryType`
+`id` | |`$mgl_featureIdentifier`
+`properties` | |`$mgl_featureProperties`
+`at` | `objectFrom:withIndex:` |
`get` | `+[NSExpression expressionForKeyPath:]` | Key path
-`has` | |
+`has` | `mgl_hasProperty:properties:` |
`length` | `count:` | `count({1, 2, 2, 3, 4, 7, 9})`
`!` | `NSNotPredicateType` | `NOT (p0 OR … OR pn)`
`!=` | `NSNotEqualToPredicateOperatorType` | `key != value`