Exemple #1
0
        internal static Task PlatformOpenMapsAsync(Placemark placemark, MapLaunchOptions options)
        {
            placemark = placemark.Escape();
            var uri = string.Empty;

            if (options.NavigationMode == NavigationMode.None)
            {
                uri = $"bingmaps:?where=" +
                      $"{placemark.Thoroughfare}" +
                      $"%20{placemark.Locality}" +
                      $"%20{placemark.AdminArea}" +
                      $"%20{placemark.PostalCode}" +
                      $"%20{placemark.CountryName}";
            }
            else
            {
                uri = $"bingmaps:?rtp=~adr." +
                      $"{placemark.Thoroughfare}" +
                      $"%20{placemark.Locality}" +
                      $"%20{placemark.AdminArea}" +
                      $"%20{placemark.PostalCode}" +
                      $"%20{placemark.CountryName}" +
                      $"{GetMode(options.NavigationMode)}";
            }

            return(LaunchUri(new Uri(uri)));
        }
        internal static Task PlatformOpenMapsAsync(Placemark placemark, MapsLaunchOptions options)
        {
            placemark = placemark.Escape();
            var uri = $"geo:0,0?q={placemark.Thoroughfare} {placemark.Locality} {placemark.AdminArea} {placemark.CountryName}";

            if (!string.IsNullOrWhiteSpace(options.Name))
            {
                uri += $"({options.Name})";
            }
            StartIntent(uri);
            return(Task.CompletedTask);
        }
        internal static Task PlatformOpenMapsAsync(Placemark placemark, MapsLaunchOptions options)
        {
            placemark = placemark.Escape();

            var uri = new Uri(
                $"bingmaps:?where=" +
                $"{placemark.Thoroughfare}" +
                $"%20{placemark.Locality}" +
                $"%20{placemark.AdminArea}" +
                $"%20{placemark.CountryName}");

            return(LaunchUri(uri));
        }
        internal static Task PlatformOpenMapsAsync(Placemark placemark, MapLaunchOptions options)
        {
            Permissions.EnsureDeclared <Permissions.LaunchApp>();

            var appControl = new AppControl
            {
                Operation = AppControlOperations.Pick,
                Uri       = "geo:",
            };

            placemark       = placemark.Escape();
            appControl.Uri += $"0,0?q={placemark.Thoroughfare} {placemark.Locality} {placemark.AdminArea} {placemark.PostalCode} {placemark.CountryName}";

            AppControl.SendLaunchRequest(appControl);

            return(Task.CompletedTask);
        }
Exemple #5
0
        internal static Task PlatformOpenMapsAsync(Placemark placemark, MapsLaunchOptions options)
        {
            placemark = placemark.Escape();
            var uri = string.Empty;

            if (options.MapDirectionsMode == MapDirectionsMode.None)
            {
                uri = $"geo:0,0?q={placemark.Thoroughfare} {placemark.Locality} {placemark.AdminArea} {placemark.PostalCode} {placemark.CountryName}";
                if (!string.IsNullOrWhiteSpace(options.Name))
                {
                    uri += $"({AndroidUri.Encode(options.Name)})";
                }
            }
            else
            {
                uri = $"google.navigation:q={placemark.Thoroughfare} {placemark.Locality} {placemark.AdminArea} {placemark.PostalCode} {placemark.CountryName}{GetMode(options.MapDirectionsMode)}";
            }

            StartIntent(uri);
            return(Task.CompletedTask);
        }