summaryrefslogtreecommitdiff
path: root/platform/darwin/include/MGLGeometry.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/include/MGLGeometry.h')
-rw-r--r--platform/darwin/include/MGLGeometry.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/platform/darwin/include/MGLGeometry.h b/platform/darwin/include/MGLGeometry.h
index 8231eed442..1c1bf65efb 100644
--- a/platform/darwin/include/MGLGeometry.h
+++ b/platform/darwin/include/MGLGeometry.h
@@ -95,4 +95,53 @@ NS_INLINE CLLocationDegrees MGLDegreesFromRadians(CGFloat radians) {
return radians * 180 / M_PI;
}
+/**
+ Methods for round-tripping Mapbox geometry structure values.
+ */
+@interface NSValue (MGLGeometryAdditions)
+
+/**
+ Creates a new value object containing the specified Core Location geographic
+ coordinate structure.
+
+ @param coordinate The value for the new object.
+ @return A new value object that contains the geographic coordinate information.
+ */
++ (instancetype)valueWithMGLCoordinate:(CLLocationCoordinate2D)coordinate;
+
+/**
+ The Core Location geographic coordinate structure representation of the value.
+ */
+@property (readonly) CLLocationCoordinate2D MGLCoordinateValue;
+
+/**
+ Creates a new value object containing the specified Mapbox coordinate span
+ structure.
+
+ @param span The value for the new object.
+ @return A new value object that contains the coordinate span information.
+ */
++ (instancetype)valueWithMGLCoordinateSpan:(MGLCoordinateSpan)span;
+
+/**
+ The Mapbox coordinate span structure representation of the value.
+ */
+@property (readonly) MGLCoordinateSpan MGLCoordinateSpanValue;
+
+/**
+ Creates a new value object containing the specified Mapbox coordinate bounds
+ structure.
+
+ @param bounds The value for the new object.
+ @return A new value object that contains the coordinate bounds information.
+ */
++ (instancetype)valueWithMGLCoordinateBounds:(MGLCoordinateBounds)bounds;
+
+/**
+ The Mapbox coordinate bounds structure representation of the value.
+ */
+@property (readonly) MGLCoordinateBounds MGLCoordinateBoundsValue;
+
+@end
+
NS_ASSUME_NONNULL_END