summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Guerra <fabian.guerra@mapbox.com>2017-04-04 12:25:20 -0400
committerFabian Guerra <fabian.guerra@mapbox.com>2017-04-04 12:25:20 -0400
commit199172cb12c062d03f902cac9bedf0123f9c045e (patch)
tree45343964b5789afda97e24baedc5b14cf162c47c
parent8e538b4d06b12a8b0649b6b98386acca5fb5eeef (diff)
downloadqtlocation-mapboxgl-upstream/fabian-multi-polygon-coordinate.tar.gz
[ios] MGLMultiPolygon's coordinate property implementedupstream/fabian-multi-polygon-coordinate
-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);
}