diff options
Diffstat (limited to 'platform/darwin/src/MGLGeometry.h')
-rw-r--r-- | platform/darwin/src/MGLGeometry.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLGeometry.h b/platform/darwin/src/MGLGeometry.h index e2a4d818b9..8e36b86d96 100644 --- a/platform/darwin/src/MGLGeometry.h +++ b/platform/darwin/src/MGLGeometry.h @@ -62,6 +62,14 @@ NS_INLINE BOOL MGLCoordinateBoundsEqualToCoordinateBounds(MGLCoordinateBounds bo bounds1.ne.longitude == bounds2.ne.longitude); } +/** Returns `YES` if the two coordinate bounds intersect. */ +NS_INLINE BOOL MGLCoordinateBoundsIntersectsCoordinateBounds(MGLCoordinateBounds bounds1, MGLCoordinateBounds bounds2) { + return (bounds1.ne.latitude > bounds2.sw.latitude && + bounds1.sw.latitude < bounds2.ne.latitude && + bounds1.ne.longitude > bounds2.sw.longitude && + bounds1.sw.longitude < bounds2.ne.longitude); +} + /** Returns `YES` if the coordinate is within the coordinate bounds. */ NS_INLINE BOOL MGLCoordinateInCoordinateBounds(CLLocationCoordinate2D coordinate, MGLCoordinateBounds bounds) { return (coordinate.latitude >= bounds.sw.latitude && |