summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLGeometry_Private.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLGeometry_Private.h')
-rw-r--r--platform/darwin/src/MGLGeometry_Private.h11
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 };