[iOS] Move radians/degrees conversion functions to MGLGeometry.h
This commit is contained in:
committed by
Justin R. Miller
parent
182bd9723e
commit
b611c9bb7b
@@ -3,6 +3,7 @@
|
||||
#import "MGLTypes.h"
|
||||
|
||||
#import <CoreLocation/CoreLocation.h>
|
||||
#import <CoreGraphics/CGBase.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -82,4 +83,14 @@ NS_INLINE NSString *MGLStringFromCoordinateBounds(MGLCoordinateBounds bounds) {
|
||||
bounds.ne.latitude, bounds.ne.longitude];
|
||||
}
|
||||
|
||||
NS_INLINE CGFloat MGLRadiansFromDegrees(CLLocationDegrees degrees)
|
||||
{
|
||||
return degrees * M_PI / 180;
|
||||
}
|
||||
|
||||
NS_INLINE CLLocationDegrees MGLDegreesFromRadians(CGFloat radians)
|
||||
{
|
||||
return radians * 180 / M_PI;
|
||||
}
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -60,16 +60,6 @@ static NSURL *MGLURLForBundledStyleNamed(NSString *styleName)
|
||||
return [NSURL URLWithString:[NSString stringWithFormat:@"asset://styles/%@.json", styleName]];
|
||||
}
|
||||
|
||||
CGFloat MGLRadiansFromDegrees(CLLocationDegrees degrees)
|
||||
{
|
||||
return degrees * M_PI / 180;
|
||||
}
|
||||
|
||||
CLLocationDegrees MGLDegreesFromRadians(CGFloat radians)
|
||||
{
|
||||
return radians * 180 / M_PI;
|
||||
}
|
||||
|
||||
mbgl::util::UnitBezier MGLUnitBezierForMediaTimingFunction(CAMediaTimingFunction *function)
|
||||
{
|
||||
if ( ! function)
|
||||
|
||||
@@ -144,16 +144,6 @@ const CGFloat MGLUserLocationAnnotationArrowSize = MGLUserLocationAnnotationPuck
|
||||
}
|
||||
}
|
||||
|
||||
CGFloat MGLRadiansFromDegrees(CLLocationDegrees degrees)
|
||||
{
|
||||
return degrees * M_PI / 180;
|
||||
}
|
||||
|
||||
CLLocationDegrees MGLDegreesFromRadians(CGFloat radians)
|
||||
{
|
||||
return radians * 180 / M_PI;
|
||||
}
|
||||
|
||||
- (UIBezierPath *)puckArrow
|
||||
{
|
||||
CGFloat max = MGLUserLocationAnnotationArrowSize;
|
||||
|
||||
Reference in New Issue
Block a user