summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLPolygon.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLPolygon.mm')
-rw-r--r--platform/darwin/src/MGLPolygon.mm7
1 files changed, 7 insertions, 0 deletions
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);
}