blob: ef894f0eb47c1b54c6f33ed6b3ee08ede38d87a7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
#import "NSValue+MGLAdditions.h"
@implementation NSValue (MGLAdditions)
#pragma mark Geometry
+ (instancetype)valueWithMGLCoordinate:(CLLocationCoordinate2D)coordinate {
return [self valueWithBytes:&coordinate objCType:@encode(CLLocationCoordinate2D)];
}
- (CLLocationCoordinate2D)MGLCoordinateValue {
CLLocationCoordinate2D coordinate;
[self getValue:&coordinate];
return coordinate;
}
+ (instancetype)valueWithMGLCoordinateSpan:(MGLCoordinateSpan)span {
return [self valueWithBytes:&span objCType:@encode(MGLCoordinateSpan)];
}
- (MGLCoordinateSpan)MGLCoordinateSpanValue {
MGLCoordinateSpan span;
[self getValue:&span];
return span;
}
+ (instancetype)valueWithMGLCoordinateBounds:(MGLCoordinateBounds)bounds {
return [self valueWithBytes:&bounds objCType:@encode(MGLCoordinateBounds)];
}
- (MGLCoordinateBounds)MGLCoordinateBoundsValue {
MGLCoordinateBounds bounds;
[self getValue:&bounds];
return bounds;
}
#pragma mark Offline maps
+ (NSValue *)valueWithMGLOfflinePackProgress:(MGLOfflinePackProgress)progress {
return [NSValue value:&progress withObjCType:@encode(MGLOfflinePackProgress)];
}
- (MGLOfflinePackProgress)MGLOfflinePackProgressValue {
MGLOfflinePackProgress progress;
[self getValue:&progress];
return progress;
}
#pragma mark Working with Transition Values
+ (NSValue *)valueWithMGLTransition:(MGLTransition)transition; {
return [NSValue value:&transition withObjCType:@encode(MGLTransition)];
}
- (MGLTransition)MGLTransitionValue {
MGLTransition transition;
[self getValue:&transition];
return transition;
}
+ (NSValue *)valueWithMGLSphericalPosition:(MGLSphericalPosition)lightPosition
{
return [NSValue value:&lightPosition withObjCType:@encode(MGLSphericalPosition)];
}
- (MGLSphericalPosition)MGLSphericalPositionValue
{
MGLSphericalPosition lightPosition;
[self getValue:&lightPosition];
return lightPosition;
}
+ (NSValue *)valueWithMGLLightAnchor:(MGLLightAnchor)lightAnchor {
return [NSValue value:&lightAnchor withObjCType:@encode(MGLLightAnchor)];
}
- (MGLLightAnchor)MGLLightAnchorValue
{
MGLLightAnchor achorType;
[self getValue:&achorType];
return achorType;
}
@end
|