summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLPolyline.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLPolyline.mm')
-rw-r--r--platform/darwin/src/MGLPolyline.mm28
1 files changed, 28 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLPolyline.mm b/platform/darwin/src/MGLPolyline.mm
new file mode 100644
index 0000000000..f560a571bc
--- /dev/null
+++ b/platform/darwin/src/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