diff options
author | Fabian Guerra Soto <fabian.guerra@mapbox.com> | 2018-05-04 12:49:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-04 12:49:58 -0400 |
commit | 86a2e93294b472898cfd005a4c34818551de0728 (patch) | |
tree | dac975b129668e4b118c8ea47920ea34f78b7c8d /platform/darwin/src/MGLGeometry_Private.h | |
parent | 167a2321d98b0733527fd4f94c11a2f33fb243e5 (diff) | |
download | qtlocation-mapboxgl-86a2e93294b472898cfd005a4c34818551de0728.tar.gz |
[ios, macos] Fix overlay bounds that span the antimeridian. (#11783)
* [ios, macos] Fix overlay bounds that span the antimeridian.
* [ios, macos] Update changelogs.
* [ios, macos] Make MGLLocationCoordinate2DIsValid private.
* [ios, macos] Update changelogs.
Diffstat (limited to 'platform/darwin/src/MGLGeometry_Private.h')
-rw-r--r-- | platform/darwin/src/MGLGeometry_Private.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLGeometry_Private.h b/platform/darwin/src/MGLGeometry_Private.h index 0bff9b09f5..d0d9446a5f 100644 --- a/platform/darwin/src/MGLGeometry_Private.h +++ b/platform/darwin/src/MGLGeometry_Private.h @@ -71,6 +71,17 @@ NS_INLINE MGLCoordinateQuad MGLCoordinateQuadFromLatLngArray(std::array<mbgl::La MGLLocationCoordinate2DFromLatLng(quad[1]) }; } +/** + YES if the coordinate is valid or NO if it is not. + Considers extended coordinates. + */ +NS_INLINE BOOL MGLLocationCoordinate2DIsValid(CLLocationCoordinate2D coordinate) { + return (coordinate.latitude <= 90.0 && + coordinate.latitude >= -90.0 && + coordinate.longitude <= 360.0 && + coordinate.longitude >= -360.0); +} + #if TARGET_OS_IPHONE NS_INLINE mbgl::EdgeInsets MGLEdgeInsetsFromNSEdgeInsets(UIEdgeInsets insets) { return { insets.top, insets.left, insets.bottom, insets.right }; |