summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLPolygon.mm
blob: 5019385cb201acdd52c9170f7f924920cd471195 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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