Exemplo n.º 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)));
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 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);
        }