diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2017-01-03 15:56:55 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2017-01-04 23:06:22 +0100 |
commit | 8bbf4c3be9ba6589dc0f7e5bf072cf68a57107b4 (patch) | |
tree | 0c46dc77841ccbce9e6f3e7285b6f525f07b69d1 /platform/darwin/src/MGLGeometry.mm | |
parent | b35deb85bc6042380ae0e7154d02faef595cfcf7 (diff) | |
download | qtlocation-mapboxgl-8bbf4c3be9ba6589dc0f7e5bf072cf68a57107b4.tar.gz |
[build] add -fvisibility=hidden to macOS dynamic framework and export required symbols
Diffstat (limited to 'platform/darwin/src/MGLGeometry.mm')
-rw-r--r-- | platform/darwin/src/MGLGeometry.mm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLGeometry.mm b/platform/darwin/src/MGLGeometry.mm index 57922e30b9..36e096dd03 100644 --- a/platform/darwin/src/MGLGeometry.mm +++ b/platform/darwin/src/MGLGeometry.mm @@ -1,5 +1,7 @@ #import "MGLGeometry_Private.h" +#import "MGLFoundation.h" + #import <mbgl/util/projection.hpp> /** Vertical field of view, measured in degrees, for determining the altitude @@ -30,6 +32,7 @@ CGRect MGLExtendRect(CGRect rect, CGPoint point) { return rect; } +MGL_EXPORT CLLocationDistance MGLAltitudeForZoomLevel(double zoomLevel, CGFloat pitch, CLLocationDegrees latitude, CGSize size) { CLLocationDistance metersPerPixel = mbgl::Projection::getMetersPerPixelAtLatitude(latitude, zoomLevel); CLLocationDistance metersTall = metersPerPixel * size.height; @@ -37,6 +40,7 @@ CLLocationDistance MGLAltitudeForZoomLevel(double zoomLevel, CGFloat pitch, CLLo return altitude * std::sin(M_PI_2 - MGLRadiansFromDegrees(pitch)) / std::sin(M_PI_2); } +MGL_EXPORT double MGLZoomLevelForAltitude(CLLocationDistance altitude, CGFloat pitch, CLLocationDegrees latitude, CGSize size) { CLLocationDistance eyeAltitude = altitude / std::sin(M_PI_2 - MGLRadiansFromDegrees(pitch)) * std::sin(M_PI_2); CLLocationDistance metersTall = eyeAltitude * 2 * std::tan(MGLRadiansFromDegrees(MGLAngularFieldOfView) / 2.); |