Version 3.0.264

This commit is contained in:
Oliver Hauff 2021-12-08 18:08:58 +01:00
parent e5c09b9b8d
commit bf8e3fa73a
18 changed files with 199 additions and 100 deletions

View file

@ -97,7 +97,7 @@ namespace TINK.ViewModel.Map
/// <summary> False if user tabed on station marker to show bikes at a given station.</summary>
private bool isMapPageEnabled = false;
Model.Services.Geolocation.IGeolocation GeolocationService { get; }
IGeolocation GeolocationService { get; }
/// <summary> False if user tabed on station marker to show bikes at a given station.</summary>
public bool IsMapPageEnabled {
@ -431,11 +431,14 @@ namespace TINK.ViewModel.Map
Log.ForContext<MapPageViewModel>().Error("Getting location failed. {Exception}", ex);
}
TinkApp.MapSpan = MapSpan.FromCenterAndRadius(
new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude),
TinkApp.MapSpan.Radius);
if (currentLocation != null)
{
TinkApp.MapSpan = MapSpan.FromCenterAndRadius(
new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude),
TinkApp.MapSpan.Radius);
TinkApp.Save();
TinkApp.Save();
}
}
MoveAndScale(m_oMoveToRegionDelegate, TinkApp.MapSpan);
@ -461,7 +464,7 @@ namespace TINK.ViewModel.Map
}
catch (Exception l_oException)
{
Log.ForContext<MapPageViewModel>().Error($"An error occurred switching view TINK/ Konrad.\r\n{l_oException.Message}");
Log.ForContext<MapPageViewModel>().Error($"An error occurred showing bike stations page.\r\n{l_oException.Message}");
IsRunning = false;
@ -882,11 +885,14 @@ namespace TINK.ViewModel.Map
Log.ForContext<MapPageViewModel>().Error("Getting location failed. {Exception}", ex);
}
TinkApp.MapSpan = MapSpan.FromCenterAndRadius(
if (currentLocation != null)
{
TinkApp.MapSpan = MapSpan.FromCenterAndRadius(
new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude),
TinkApp.MapSpan.Radius);
TinkApp.Save();
TinkApp.Save();
}
}
// Update stations