diff options
Diffstat (limited to 'platform/darwin/src/MGLGeometry.h')
-rw-r--r-- | platform/darwin/src/MGLGeometry.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLGeometry.h b/platform/darwin/src/MGLGeometry.h index 7c68033abf..5d8e7eccd5 100644 --- a/platform/darwin/src/MGLGeometry.h +++ b/platform/darwin/src/MGLGeometry.h @@ -14,6 +14,16 @@ typedef struct __attribute__((objc_boxable)) MGLCoordinateSpan { CLLocationDegrees longitudeDelta; } MGLCoordinateSpan; +/* Defines a point on the map in Mercator projection for a specific zoom level. */ +typedef struct __attribute__((objc_boxable)) MGLMapPoint { + /** X coordinate representing a longitude in Mercator projection. */ + CGFloat x; + /** Y coordinate representing a latitide in Mercator projection. */ + CGFloat y; + /** Zoom level at which the X and Y coordinates are valid. */ + CGFloat zoomLevel; +} MGLMapPoint; + /** Creates a new `MGLCoordinateSpan` from the given latitudinal and longitudinal deltas. @@ -181,4 +191,7 @@ NS_INLINE CLLocationDegrees MGLDegreesFromRadians(CGFloat radians) { return radians * 180 / M_PI; } +/** Returns Mercator projection of a WGS84 coordinate at the specified zoom level. */ +extern MGL_EXPORT MGLMapPoint MGLMapPointMake(CLLocationCoordinate2D coordinate, double zoomLevel); + NS_ASSUME_NONNULL_END |