From 199172cb12c062d03f902cac9bedf0123f9c045e Mon Sep 17 00:00:00 2001 From: Fabian Guerra Date: Tue, 4 Apr 2017 12:25:20 -0400 Subject: [ios] MGLMultiPolygon's coordinate property implemented --- platform/darwin/src/MGLPolygon.mm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/darwin/src/MGLPolygon.mm b/platform/darwin/src/MGLPolygon.mm index ceafe873bf..bec29a56d3 100644 --- a/platform/darwin/src/MGLPolygon.mm +++ b/platform/darwin/src/MGLPolygon.mm @@ -155,6 +155,13 @@ return hash; } +- (CLLocationCoordinate2D)coordinate { + NSAssert(self.polygons.count > 0, @"A multipolygon must have coordinates"); + + MGLPolygon *firstPolygon = [self.polygons firstObject]; + return firstPolygon.coordinate; +} + - (BOOL)intersectsOverlayBounds:(MGLCoordinateBounds)overlayBounds { return MGLCoordinateBoundsIntersectsCoordinateBounds(_overlayBounds, overlayBounds); } -- cgit v1.2.1