summaryrefslogtreecommitdiff
path: root/platform/darwin/MGLPolygon.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/MGLPolygon.mm')
-rw-r--r--platform/darwin/MGLPolygon.mm28
1 files changed, 28 insertions, 0 deletions
diff --git a/platform/darwin/MGLPolygon.mm b/platform/darwin/MGLPolygon.mm
new file mode 100644
index 0000000000..5019385cb2
--- /dev/null
+++ b/platform/darwin/MGLPolygon.mm
@@ -0,0 +1,28 @@
+#import "MGLPolygon.h"
+
+#import "MGLMultiPoint_Private.h"
+
+@implementation MGLPolygon
+
+@dynamic overlayBounds;
+
++ (instancetype)polygonWithCoordinates:(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::FillAnnotationProperties fillProperties;
+ fillProperties.opacity = [delegate alphaForShapeAnnotation:self];
+ fillProperties.outlineColor = [delegate strokeColorForShapeAnnotation:self];
+ fillProperties.color = [delegate fillColorForPolygonAnnotation:self];
+
+ shapeProperties.set<mbgl::FillAnnotationProperties>(fillProperties);
+
+ return shapeProperties;
+}
+
+@end