void SetMapToCoordinate(CoreLocation.CLLocationCoordinate2D coordinate)
        {
            var currentSpan = new MapKit.MKCoordinateSpan (0.05, 0.05);
            var region = new MapKit.MKCoordinateRegion (coordinate, currentSpan);

            MyMap.SetRegion (region, true);
        }
        void SetMapToCoordinate(CoreLocation.CLLocationCoordinate2D coordinate)
        {
            var currentSpan = new MapKit.MKCoordinateSpan (0.05, 0.05);
            var region = new MapKit.MKCoordinateRegion (coordinate, currentSpan);

            var newCenterPoint = MapKit.MKMapPoint.FromCoordinate (coordinate);

            CoffeeMap.SetVisible (new MapKit.MKMapRect (newCenterPoint.X, newCenterPoint.Y, currentSpan.LatitudeDelta, currentSpan.LongitudeDelta));
            CoffeeMap.SetRegion (region);
        }
    /// <summary>
    /// Starts the Native Map Navigation
    /// Implementation from https://github.com/jamesmontemagno/Xamarin.Plugins/tree/master/ExternalMaps
    /// </summary>
    /// <param name="navigationModel"></param>
    public void LaunchNavigationAsync(NavigationModel navigationModel)
    {
      var mapItem =
        new MKMapItem(new MKPlacemark(new CLLocationCoordinate2D(navigationModel.Latitude, navigationModel.Longitude),
          new MKPlacemarkAddress{Street = navigationModel.DestinationAddress})) {Name = navigationModel.DestinationName};

      var launchOptions =
         new MKLaunchOptions
        {
          DirectionsMode =  MKDirectionsMode.Driving
        };

      var mapItems = new[] { mapItem };

      MKMapItem.OpenMaps(mapItems, launchOptions);
    }
 static void DownloadRelease()
 {
     if (CoreLocation.GetDirectories().Length <= 0)
     {
         MainWindow.Dispatcher.Invoke(() => {
             MainWindow.GridDownload.Visibility = Visibility.Visible;
         });
         using (var client = new WebClient()) {
             client.Headers.Add("user-agent", "GuitarSnifferWrapper");
             var jsonS = client.DownloadString(githubLatest);
             var jObj  = JObject.Parse(jsonS);
             client.DownloadFile(jObj.GetValue("assets")[0].Value <string>("browser_download_url"), "GuitarSnifferCore.zip");
         }
         CoreLocation.Delete(true);
         CoreLocation.Create();
         ZipFile.ExtractToDirectory("GuitarSnifferCore.zip", CoreLocation.FullName);
         File.Delete("GuitarSnifferCore.zip");
         MainWindow.Dispatcher.Invoke(() => {
             MainWindow.GridDownload.Visibility = Visibility.Hidden;
         });
     }
 }
 private void processNewGpsUpdated(CoreLocation.CLLocation location)
 {
     Global.currentPosition = new Xamarin.Forms.Maps.Position (location.Coordinate.Latitude, location.Coordinate.Longitude);
     var x = new platformSpecific_IOS ();
     x.userlatitude = location.Coordinate.Latitude;
     x.userlongitude = location.Coordinate.Longitude;
     Global.PositionChangedNumber += 1;
     Global.calculateDistance (false);
     Global.LocationUpdatePending = true;
 }
 public void UpdatedLocation(CoreLocation.CLLocationManager manager, CoreLocation.CLLocation newLocation, CoreLocation.CLLocation oldLocation)
 {
     Console.WriteLine("Lat {0} Long {1}", newLocation.Coordinate.Latitude, newLocation.Coordinate.Longitude);
 }