summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Prukop <dave.prukop@mapbox.com>2018-09-28 10:30:11 -0700
committerDave Prukop <dave.prukop@mapbox.com>2018-09-28 10:30:11 -0700
commit1250639a5f78e2503b79dcf08b634146787e96af (patch)
tree2b19d80e203dc578318824d8e3b7825ec9c67720
parent0dff7879f67d446eda57033618f7b082e3716496 (diff)
downloadqtlocation-mapboxgl-1250639a5f78e2503b79dcf08b634146787e96af.tar.gz
Moved MGLAltitudeForZoomLevel and MGLZoomLevelForAltitude to public API
-rw-r--r--platform/darwin/src/MGLGeometry.h21
-rw-r--r--platform/darwin/src/MGLGeometry_Private.h18
2 files changed, 20 insertions, 19 deletions
diff --git a/platform/darwin/src/MGLGeometry.h b/platform/darwin/src/MGLGeometry.h
index 50474a7ba5..c3450359aa 100644
--- a/platform/darwin/src/MGLGeometry.h
+++ b/platform/darwin/src/MGLGeometry.h
@@ -1,6 +1,6 @@
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
-#import <CoreGraphics/CGBase.h>
+#import <CoreGraphics/CoreGraphics.h>
#import "MGLFoundation.h"
@@ -213,4 +213,23 @@ NS_INLINE CLLocationDegrees MGLDegreesFromRadians(CGFloat radians) {
/** Returns Mercator projection of a WGS84 coordinate at the specified zoom level. */
FOUNDATION_EXTERN MGL_EXPORT MGLMapPoint MGLMapPointForCoordinate(CLLocationCoordinate2D coordinate, double zoomLevel);
+
+/** Converts a map zoom level to a camera altitude.
+
+ @param zoomLevel The zoom level to convert.
+ @param pitch The camera pitch, measured in degrees.
+ @param latitude The latitude of the point at the center of the viewport.
+ @param size The size of the viewport.
+ @return An altitude measured in meters. */
+FOUNDATION_EXTERN MGL_EXPORT CLLocationDistance MGLAltitudeForZoomLevel(double zoomLevel, CGFloat pitch, CLLocationDegrees latitude, CGSize size);
+
+/** Converts a camera altitude to a map zoom level.
+
+ @param altitude The altitude to convert, measured in meters.
+ @param pitch The camera pitch, measured in degrees.
+ @param latitude The latitude of the point at the center of the viewport.
+ @param size The size of the viewport.
+ @return A zero-based zoom level. */
+FOUNDATION_EXTERN MGL_EXPORT double MGLZoomLevelForAltitude(CLLocationDistance altitude, CGFloat pitch, CLLocationDegrees latitude, CGSize size);
+
NS_ASSUME_NONNULL_END
diff --git a/platform/darwin/src/MGLGeometry_Private.h b/platform/darwin/src/MGLGeometry_Private.h
index 4ea3dfe6e3..b4afce82be 100644
--- a/platform/darwin/src/MGLGeometry_Private.h
+++ b/platform/darwin/src/MGLGeometry_Private.h
@@ -92,24 +92,6 @@ NS_INLINE mbgl::EdgeInsets MGLEdgeInsetsFromNSEdgeInsets(NSEdgeInsets insets) {
}
#endif
-/** Converts a map zoom level to a camera altitude.
-
- @param zoomLevel The zoom level to convert.
- @param pitch The camera pitch, measured in degrees.
- @param latitude The latitude of the point at the center of the viewport.
- @param size The size of the viewport.
- @return An altitude measured in meters. */
-MGL_EXPORT CLLocationDistance MGLAltitudeForZoomLevel(double zoomLevel, CGFloat pitch, CLLocationDegrees latitude, CGSize size);
-
-/** Converts a camera altitude to a map zoom level.
-
- @param altitude The altitude to convert, measured in meters.
- @param pitch The camera pitch, measured in degrees.
- @param latitude The latitude of the point at the center of the viewport.
- @param size The size of the viewport.
- @return A zero-based zoom level. */
-MGL_EXPORT double MGLZoomLevelForAltitude(CLLocationDistance altitude, CGFloat pitch, CLLocationDegrees latitude, CGSize size);
-
/** Returns MGLRadianCoordinate2D, converted from CLLocationCoordinate2D. */
NS_INLINE MGLRadianCoordinate2D MGLRadianCoordinateFromLocationCoordinate(CLLocationCoordinate2D locationCoordinate) {
return MGLRadianCoordinate2DMake(MGLRadiansFromDegrees(locationCoordinate.latitude),