diff --git a/platform/ios/src/MGLScaleBar.mm b/platform/ios/src/MGLScaleBar.mm index 383710ea3..1216e400b 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 {