summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLPolyline.mm
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2018-01-02 15:36:37 -0500
committerJason Wray <jason@mapbox.com>2018-01-02 19:36:31 -0500
commit637892cd6f0f8953b787b9d727bdf82ed3813c96 (patch)
tree20341a2b2908cec211b37ead7dab3b6cd2b5d170 /platform/darwin/src/MGLPolyline.mm
parent1dd5e405c113bac4446b5b5175b92ce7ff7467bf (diff)
downloadqtlocation-mapboxgl-637892cd6f0f8953b787b9d727bdf82ed3813c96.tar.gz
[ios, macos] Move private categories into explicitly private headers
Instead of creating `MGLAdditions` categories/files for our own classes, this standardizes on the `Private` convention that we had been using elsewhere. This also fixes build errors where the `MGLAdditions` categories weren't importing their parents.
Diffstat (limited to 'platform/darwin/src/MGLPolyline.mm')
-rw-r--r--platform/darwin/src/MGLPolyline.mm13
1 files changed, 11 insertions, 2 deletions
diff --git a/platform/darwin/src/MGLPolyline.mm b/platform/darwin/src/MGLPolyline.mm
index 0e371a4dda..e011d09215 100644
--- a/platform/darwin/src/MGLPolyline.mm
+++ b/platform/darwin/src/MGLPolyline.mm
@@ -1,9 +1,9 @@
-#import "MGLPolyline.h"
+#import "MGLPolyline_Private.h"
#import "MGLMultiPoint_Private.h"
#import "MGLGeometry_Private.h"
-#import "MGLPolyline+MGLAdditions.h"
+#import "MGLFeature.h"
#import <mbgl/util/geojson.hpp>
#import <mapbox/polylabel.hpp>
@@ -49,6 +49,15 @@
@"coordinates": self.mgl_coordinates};
}
+- (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];
+}
+
- (BOOL)isEqual:(id)other {
return self == other || ([other isKindOfClass:[MGLPolyline class]] && [super isEqual:other]);
}