blob: 5d42b5a51ca38b70a68a31511276b4dc6d17c435 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#import "MGLShapeCollection.h"
@implementation MGLShapeCollection
+ (instancetype)shapeCollectionWithShapes:(NS_ARRAY_OF(MGLShape *) *)shapes {
return [[self alloc] initWithShapes:shapes];
}
- (instancetype)initWithShapes:(NS_ARRAY_OF(MGLShape *) *)shapes {
if (self = [super init]) {
NSAssert(shapes.count, @"Cannot create an empty shape collection");
_shapes = shapes.copy;
}
return self;
}
- (CLLocationCoordinate2D)coordinate {
return _shapes.firstObject.coordinate;
}
@end
|