diff options
author | Fabian Guerra <fabian.guerra@mapbox.com> | 2017-04-04 12:25:20 -0400 |
---|---|---|
committer | Fabian Guerra <fabian.guerra@mapbox.com> | 2017-04-04 12:25:20 -0400 |
commit | 199172cb12c062d03f902cac9bedf0123f9c045e (patch) | |
tree | 45343964b5789afda97e24baedc5b14cf162c47c | |
parent | 8e538b4d06b12a8b0649b6b98386acca5fb5eeef (diff) | |
download | qtlocation-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.mm | 7 |
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); } |