summaryrefslogtreecommitdiff
path: root/platform/darwin/MGLGeometry_Private.h
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-02-11 12:21:49 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-02-12 14:53:52 -0800
commit13e2acbc754893efb945fe02d20824698415dcdb (patch)
treee8e4c966f03798fc6896a0fd3163e83921f84a38 /platform/darwin/MGLGeometry_Private.h
parentab677a7905b0f81850d6aa3dcdd2caebc0dbc851 (diff)
downloadqtlocation-mapboxgl-13e2acbc754893efb945fe02d20824698415dcdb.tar.gz
[ios, osx] Consolidate remaining files in platform/{ios,osx}
Diffstat (limited to 'platform/darwin/MGLGeometry_Private.h')
-rw-r--r--platform/darwin/MGLGeometry_Private.h64
1 files changed, 0 insertions, 64 deletions
diff --git a/platform/darwin/MGLGeometry_Private.h b/platform/darwin/MGLGeometry_Private.h
deleted file mode 100644
index 72123827df..0000000000
--- a/platform/darwin/MGLGeometry_Private.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#import "MGLGeometry.h"
-
-#import <TargetConditionals.h>
-#if TARGET_OS_IPHONE
- #import <UIKit/UIKit.h>
-#endif
-
-#import <mbgl/map/map.hpp>
-#import <mbgl/util/geo.hpp>
-
-/// Returns the smallest rectangle that contains both the given rectangle and
-/// the given point.
-CGRect MGLExtendRect(CGRect rect, CGPoint point);
-
-NS_INLINE mbgl::LatLng MGLLatLngFromLocationCoordinate2D(CLLocationCoordinate2D coordinate) {
- return mbgl::LatLng(coordinate.latitude, coordinate.longitude);
-}
-
-NS_INLINE CLLocationCoordinate2D MGLLocationCoordinate2DFromLatLng(mbgl::LatLng latLng) {
- return CLLocationCoordinate2DMake(latLng.latitude, latLng.longitude);
-}
-
-NS_INLINE MGLCoordinateBounds MGLCoordinateBoundsFromLatLngBounds(mbgl::LatLngBounds latLngBounds) {
- return MGLCoordinateBoundsMake(MGLLocationCoordinate2DFromLatLng(latLngBounds.southwest()),
- MGLLocationCoordinate2DFromLatLng(latLngBounds.northeast()));
-}
-
-NS_INLINE mbgl::LatLngBounds MGLLatLngBoundsFromCoordinateBounds(MGLCoordinateBounds coordinateBounds) {
- return mbgl::LatLngBounds::hull(MGLLatLngFromLocationCoordinate2D(coordinateBounds.sw),
- MGLLatLngFromLocationCoordinate2D(coordinateBounds.ne));
-}
-
-NS_INLINE BOOL MGLCoordinateInCoordinateBounds(CLLocationCoordinate2D coordinate, MGLCoordinateBounds coordinateBounds) {
- mbgl::LatLngBounds bounds = MGLLatLngBoundsFromCoordinateBounds(coordinateBounds);
- return bounds.contains(MGLLatLngFromLocationCoordinate2D(coordinate));
-}
-
-#if TARGET_OS_IPHONE
-NS_INLINE mbgl::EdgeInsets MGLEdgeInsetsFromNSEdgeInsets(UIEdgeInsets insets) {
- return { insets.top, insets.left, insets.bottom, insets.right };
-}
-#else
-NS_INLINE mbgl::EdgeInsets MGLEdgeInsetsFromNSEdgeInsets(NSEdgeInsets insets) {
- return { insets.top, insets.left, insets.bottom, insets.right };
-}
-#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. */
-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. */
-double MGLZoomLevelForAltitude(CLLocationDistance altitude, CGFloat pitch, CLLocationDegrees latitude, CGSize size);