Xamarin card opens iOS card in the wrong place

I am developing an application in xamarin formats that should work on Android and ios. The problem is that iOS cards are displaying the wrong location.

IOS Location (WRONG)

IOS Location (WRONG)

Android Location (RIGHT)

Android Location (RIGHT)

the code:

switch (Device.RuntimePlatform)
        {
            case Device.iOS:
                uri = new Uri(string.Format("http://maps.apple.com/?ll={0}", x + ',' + y));
                System.Diagnostics.Debug.WriteLine(uri);
                Device.OpenUri(uri);
            break;

            case Device.Android:
                uri = new Uri("https://www.google.com/maps/search/?api=1&query=" + x + ',' + y);
                System.Diagnostics.Debug.WriteLine(uri);
                Device.OpenUri(uri);
            break;

        }

In this example x="39.7301803"andy="-8.8438668"

UPDATE

Replacing the above code with a plugin ExternalMaps

var success = CrossExternalMaps.Current.NavigateTo(Store.Name, Double.Parse(x), Double.Parse(y));

Exactly the same result: (

+4
source share
2 answers

Both of your links (manually added) open in the desired application and point to the same location

y param "0", . , ? y ( )

?

, . iOS:

uri = new Uri("http://maps.apple.com/?ll="+ x + ',' + y));
+2

, . , URL- . "" Xamarin.Forms. , .

- Xamarin.Forms.Map

-1

, . , Xamarin.iOS, Xamarin.Android, Windows Xamarin.Forms.

, , this.

, , . .

0

Source: https://habr.com/ru/post/1691359/


All Articles