summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLPolyline+MGLAdditions.m
blob: d1db2c58a0f353a606d859c4e988b3db32cf064f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#import "MGLPolyline+MGLAdditions.h"

@implementation MGLPolyline (MGLAdditions)

- (NS_ARRAY_OF(id) *)mgl_coordinates {
    NSMutableArray *coordinates = [[NSMutableArray alloc] initWithCapacity:self.pointCount];
    for (NSUInteger index = 0; index < self.pointCount; index++) {
        CLLocationCoordinate2D coordinate = self.coordinates[index];
        [coordinates addObject:@[@(coordinate.longitude), @(coordinate.latitude)]];
    }
    return [coordinates copy];
}

@end