summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLPolygon.mm
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-02-11 12:21:49 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-02-12 14:53:52 -0800
commit13e2acbc754893efb945fe02d20824698415dcdb (patch)
treee8e4c966f03798fc6896a0fd3163e83921f84a38 /platform/darwin/src/MGLPolygon.mm
parentab677a7905b0f81850d6aa3dcdd2caebc0dbc851 (diff)
downloadqtlocation-mapboxgl-13e2acbc754893efb945fe02d20824698415dcdb.tar.gz
[ios, osx] Consolidate remaining files in platform/{ios,osx}
Diffstat (limited to 'platform/darwin/src/MGLPolygon.mm')
-rw-r--r--platform/darwin/src/MGLPolygon.mm28
1 files changed, 28 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLPolygon.mm b/platform/darwin/src/MGLPolygon.mm
new file mode 100644
index 0000000000..5019385cb2
--- /dev/null
+++ b/platform/darwin/src/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