summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform/ios/src/MGLScaleBar.mm3
1 files changed, 2 insertions, 1 deletions
diff --git a/platform/ios/src/MGLScaleBar.mm b/platform/ios/src/MGLScaleBar.mm
index 383710ea37..1216e400b3 100644
--- a/platform/ios/src/MGLScaleBar.mm
+++ b/platform/ios/src/MGLScaleBar.mm
@@ -161,7 +161,8 @@ static const CGFloat MGLFeetPerMeter = 3.28084;
}
- (CGFloat)actualWidth {
- return self.row.distance / [self unitsPerPoint];
+ CGFloat width = self.row.distance / [self unitsPerPoint];
+ return !isnan(width) ? width : 0;
}
- (CGFloat)maximumWidth {