From aa04438515ddc6cfc3b862964d3ce23131f4d4cf Mon Sep 17 00:00:00 2001 From: Ian Wagner Date: Thu, 27 Jul 2017 22:28:41 -0400 Subject: Set location to nil until the user's location is determined MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The documentation for the `location` property states that "This property contains `nil` if the map view is not currently showing the user location or if the user’s location has not yet been determined." The iOS SDK presently returns a garbage value, which has some rather annoying consequences when the value should logically be nullable. This change should rectify the issue. --- platform/ios/src/MGLUserLocation.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/ios/src/MGLUserLocation.m b/platform/ios/src/MGLUserLocation.m index 1c9649c09e..84d2297b6d 100644 --- a/platform/ios/src/MGLUserLocation.m +++ b/platform/ios/src/MGLUserLocation.m @@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_END { if (self = [super init]) { - _location = [[CLLocation alloc] initWithLatitude:MAXFLOAT longitude:MAXFLOAT]; + _location = nil; _mapView = mapView; } -- cgit v1.2.1