Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
GH-343: Take into consideration VerticalAccuracy on iOS Altitude (#344)
Browse files Browse the repository at this point in the history
* Fix for #343

Only set altitude if it's available (VerticalAccuracy is negative when it isn't according to iOS doc)

* Use: (double?)
  • Loading branch information
dotMorten authored and jamesmontemagno committed Jun 29, 2018
1 parent 26c14c7 commit 6df6d08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Xamarin.Essentials/Types/LocationExtensions.ios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal static Location ToLocation(this CLLocation location) =>
{
Latitude = location.Coordinate.Latitude,
Longitude = location.Coordinate.Longitude,
Altitude = location.Altitude,
Altitude = location.VerticalAccuracy < 0 ? (double?)null : location.Altitude,
Accuracy = location.HorizontalAccuracy,
TimestampUtc = location.Timestamp.ToDateTime()
};
Expand Down

0 comments on commit 6df6d08

Please sign in to comment.