summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLGeometry.h
diff options
context:
space:
mode:
authorAsheem Mamoowala <asheem.mamoowala@mapbox.com>2017-12-18 17:11:43 -0800
committerAsheem Mamoowala <asheem.mamoowala@mapbox.com>2018-04-05 18:04:25 -0700
commitcc01781db7281032f8c0c5eae54281187522a861 (patch)
treec12b23f6b69f8499a4d3db476b0f30c693c654e2 /platform/darwin/src/MGLGeometry.h
parentdc495e1c9d831ccf928381845ffcb409c5d91271 (diff)
downloadqtlocation-mapboxgl-cc01781db7281032f8c0c5eae54281187522a861.tar.gz
[ios, macos] Projection Matrix and LatLng projection to Mercator methods
Diffstat (limited to 'platform/darwin/src/MGLGeometry.h')
-rw-r--r--platform/darwin/src/MGLGeometry.h13
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