Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[ios, macos] Add documentation for lookup and feature operators.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian-guerra committed Mar 29, 2018
1 parent 0a9b7a0 commit a51ae90
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
10 changes: 5 additions & 5 deletions platform/darwin/docs/guides/For Style Authors.md.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
1 change: 1 addition & 0 deletions platform/darwin/docs/guides/Predicates and Expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion platform/darwin/src/NSExpression+MGLAdditions.mm
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ - (id)mgl_coalesce:(NSArray<NSExpression *> *)elements {
}

/**
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
Expand Down
10 changes: 5 additions & 5 deletions platform/ios/docs/guides/For Style Authors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
10 changes: 5 additions & 5 deletions platform/macos/docs/guides/For Style Authors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit a51ae90

Please sign in to comment.