Moved feature selection to the context menu and restored the press gesture for dropping a pin. Bust complex features into simple shapes to feed into MGLMapView as overlays.
22 lines
519 B
Objective-C
22 lines
519 B
Objective-C
#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
|