[ios, macos] Added distance expression function

Installed an mgl_distanceFrom: aftermarket expression function that corresponds to the “distance” expression operator in style JSON.
This commit is contained in:
Minh Nguyễn
2020-05-01 11:59:04 -07:00
committed by Minh Nguyễn
parent 93141ac0f0
commit 27eee6adf5
8 changed files with 45 additions and 3 deletions

View File

@@ -4,7 +4,7 @@
### Styles and rendering
* Added the `distance` expression function for calculating the shortest distance between the evaluated feature and a GeoJSON `Point`, `MultiPoint`, `LineString`, or `MultiLineString` geometry that you specify. Use this function in expressions in style JSON or with the `MGL_FUNCTION()` syntax in an `NSExpression` format string. ([mapbox/mapbox-gl-native#16397](https://github.com/mapbox/mapbox-gl-native/pull/16397))
* Added the `mgl_distanceFrom:` expression function for calculating the shortest distance between the evaluated feature and an `MGLPointAnnotation`, `MGLPointCollection`, `MGLPolyline`, or `MGLMultiPolyline` that you specify as part of an `NSExpression` format string. ([#295](https://github.com/mapbox/mapbox-gl-native-ios/pull/295))
* Added the `MGLCircleStyleLayer.circleSortKey` property. ([mapbox/mapbox-gl-native#15875](https://github.com/mapbox/mapbox-gl-native/pull/15875))
* Chinese, Japanese, and Korean characters are now set in the font specified in style JSON or by the `MGLSymbolLayer.textFontNames` property. If the named font is not installed on the device or bundled with the application, the characters are set in a fallback font listed in the `MGLIdeographicFontFamilyName` key in the Info.plist file. ([#189](https://github.com/mapbox/mapbox-gl-native-ios/pull/189))
* The `MGLIdeographicFontFamilyName` key in the Info.plist file can now specify the fallback fonts for CJK characters by their PostScript names or display names in addition to font family names. For example, you can specify `NotoSansCJKjp-Bold` or `Noto Sans CJK JP Bold`, which ensures that the characters are set in bold. You can alternatively specify these font names in the `MGLIdeographicFontFamilyName` key of `NSUserDefaults.standardUserDefaults`. ([#189](https://github.com/mapbox/mapbox-gl-native-ios/pull/189))

View File

@@ -370,6 +370,7 @@ In style specification | Method, function, or predicate type | Format string syn
`atan` | `mgl_atan:` | `mgl_atan(20)`
`ceil` | `ceiling:` | `ceiling(0.99999)`
`cos` | `mgl_cos:` | `mgl_cos(0)`
`distance` | | `mgl_distanceFrom(%@)` where `%@` is an `MGLShape`
`e` | | `%@` representing `NSNumber` containing `M_E`
`floor` | `floor:` | `floor(-0.99999)`
`ln` | `ln:` | `ln(2)`