summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLPointCollection.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLPointCollection.mm')
-rw-r--r--platform/darwin/src/MGLPointCollection.mm9
1 files changed, 7 insertions, 2 deletions
diff --git a/platform/darwin/src/MGLPointCollection.mm b/platform/darwin/src/MGLPointCollection.mm
index d8f0f0d3dc..8f20d91a42 100644
--- a/platform/darwin/src/MGLPointCollection.mm
+++ b/platform/darwin/src/MGLPointCollection.mm
@@ -54,6 +54,10 @@ NS_ASSUME_NONNULL_BEGIN
if (!_bounds) {
mbgl::LatLngBounds bounds = mbgl::LatLngBounds::empty();
for (auto coordinate : _coordinates) {
+ if (!CLLocationCoordinate2DIsValid(coordinate)) {
+ bounds = mbgl::LatLngBounds::empty();
+ break;
+ }
bounds.extend(MGLLatLngFromLocationCoordinate2D(coordinate));
}
_bounds = bounds;
@@ -119,8 +123,9 @@ NS_ASSUME_NONNULL_BEGIN
- (NSString *)description
{
- return [NSString stringWithFormat:@"<%@: %p; count = %lu>",
- NSStringFromClass([self class]), (void *)self, (unsigned long)[self pointCount]];
+ return [NSString stringWithFormat:@"<%@: %p; count = %lu; bounds = %@>",
+ NSStringFromClass([self class]), (void *)self, (unsigned long)[self pointCount],
+ MGLStringFromCoordinateBounds(self.overlayBounds)];
}
@end