コード例 #1
0
 public async Task SetupInit()
 {
     if (!await LetLocationStart())
     {
         MessengerService.Toast(this, "Unable to get current location", true);
     }
     MapDrawer.MoveCameraZoom(CurrentLocation, 8);
     try
     {
         var path = DatabaseService.GetInstance().GetClosestRiver();
         if (path.Points != null)
         {
             MapDrawer.DrawLine(path.Points.ToArray());
             var launchSites = from p in DatabaseService.GetInstance().Points where p.RiverId == DatabaseService.GetInstance().ClosestRiverId&& p.IsLaunchSite select p;
             foreach (var site in launchSites)
             {
                 MapDrawer.DrawMarker(site);
             }
         }
         else
         {
             MessengerService.Toast(this, "Failed to get nearest river", true);
         }
     }
     catch (Exception)
     {
         MessengerService.Toast(this, "Failed to get nearest river", true);
     }
 }