summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLPolyline.mm
blob: f560a571bce656cf8ff61f0f701695a42ce3d278 (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 "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