Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Xamarin forms maps interaction do not work in Android

$
0
0

I' have a very strange issue with Xamarin.Forms.Maps.
I'm trying to implement a page with a map that get current location and move to region at page start.

All is working fine in IOS, but in Android, Geocoder & MoveToRegion are not working at all. Only the map is displayed.

I retrieve the location correctly (Long & Lat ) in the emulators & device.
MoveToRegion do nothing & GetAddressesForPositionAsync retrive nothing.

Here the information in my manifest :

<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="mykey" />
        <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

Here the code :

map.MoveToRegion(MapSpan.FromCenterAndRadius(
                new Xamarin.Forms.Maps.Position(coordinates.Lat.Value, coordinates.Lng.Value), Distance.FromMiles(1))
            );

        var possibleAddresses = await locator.GetAddressesForPositionAsync(position);

I tried in Genymotion, Emulator from AVD and a real device.

Any idea ?


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>