diff options
Diffstat (limited to 'platform/darwin/MGLPolyline.mm')
-rw-r--r-- | platform/darwin/MGLPolyline.mm | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/platform/darwin/MGLPolyline.mm b/platform/darwin/MGLPolyline.mm new file mode 100644 index 0000000000..f560a571bc --- /dev/null +++ b/platform/darwin/MGLPolyline.mm @@ -0,0 +1,28 @@ +#import "MGLPolyline.h" + +#import "MGLMultiPoint_Private.h" + +@implementation MGLPolyline + +@dynamic overlayBounds; + ++ (instancetype)polylineWithCoordinates:(CLLocationCoordinate2D *)coords + count:(NSUInteger)count +{ + return [[self alloc] initWithCoordinates:coords count:count]; +} + +- (mbgl::ShapeAnnotation::Properties)shapeAnnotationPropertiesObjectWithDelegate:(id <MGLMultiPointDelegate>)delegate { + mbgl::ShapeAnnotation::Properties shapeProperties = [super shapeAnnotationPropertiesObjectWithDelegate:delegate]; + + mbgl::LineAnnotationProperties lineProperties; + lineProperties.opacity = [delegate alphaForShapeAnnotation:self]; + lineProperties.color = [delegate strokeColorForShapeAnnotation:self]; + lineProperties.width = [delegate lineWidthForPolylineAnnotation:self]; + + shapeProperties.set<mbgl::LineAnnotationProperties>(lineProperties); + + return shapeProperties; +} + +@end |