public async void NavMap() { try { var request = new GeolocationRequest(GeolocationAccuracy.Medium); var location = await Geolocation.GetLocationAsync(request); if (location != null) { Message = ($"Latitude: {location.Latitude}, Longitude: {location.Longitude}, Altitude: {location.Altitude}"); } var location2 = new Location(location.Latitude, location.Longitude); var options = new MapsLaunchOptions { Name = "We see you :) " }; await Maps.OpenAsync(location2, options); } catch (FeatureNotSupportedException fnsEx) { Message = fnsEx.Message; } catch (PermissionException pEx) { Message = pEx.Message; } catch (Exception ex) { Message = ex.Message; } PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Message))); }
public override async void OnNavigatedTo(NavigationParameters parameters) { ReadBadgesData(); if (ItemsSource.Count > 0) { ShowNoDataMessage = false; } //await CrossPayPalManager.Current.AuthorizeProfileSharing(); //var result = await CrossPayPalManager.Current.Buy(new PayPalItem("Shelving/cabinetry for 2 closets", new Decimal(50), "CAD"), new Decimal(0)); //if (result.Status == PayPalStatus.Cancelled) //{ // Debug.WriteLine("Cancelled"); //} //else if (result.Status == PayPalStatus.Error) //{ // Debug.WriteLine(result.ErrorMessage); //} //else if (result.Status == PayPalStatus.Successful) //{ // Debug.WriteLine(result.ServerResponse.Response.Id); //} //Map test var location = new Location(47.645160, -122.1306032); var options = new MapsLaunchOptions { MapDirectionsMode = MapDirectionsMode.Driving }; await Maps.OpenAsync(location, options); }
async void NavBtn_Clicked(object sender, System.EventArgs e) { var location = new Location(geodata.Coordinates[0].Latitude, geodata.Coordinates[0].Longitude); var options = new MapsLaunchOptions { Name = geodata.Name, MapDirectionsMode = MapDirectionsMode.Walking }; await Maps.OpenAsync(location, options); }
private async void LocationButton_Clicked(object sender, EventArgs e) { Button button = (Button)sender; var tempString = button.StyleId.Split(';'); double.TryParse(tempString[0], out double Latitude); double.TryParse(tempString[1], out double Longitude); var location = new Location(Latitude, Longitude); var options = new MapsLaunchOptions { Name = "Transaction Location" }; await Maps.OpenAsync(location, options); }
private async void ExecuteOpenMapCommand(object obj) { var placemark = new Placemark { CountryName = this.Pet.Country, AdminArea = this.Pet.City, Thoroughfare = "PetShop", Locality = this.Pet.City }; var options = new MapsLaunchOptions { Name = this.Pet.Name }; await Maps.OpenAsync(placemark, options); }