Files
MapLibreParticleLab/platform/darwin/src/MGLShapeCollection.m
Minh Nguyễn b94a125ff2 [osx] Relegated “selection” to context menu
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.
2016-05-27 21:42:39 -07:00

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