Ranjith Kumar Nagiri
Ranjith Kumar Nagiri

Reputation: 863

IsShowingUser not working in Xamarin Forms

i'm developing an app based on maps. Here my problem is i'm not able to display user location on maps. but i can able to displaying the map's using Xamarin.Forms. Here is my Code

var map = new Map(
MapSpan.FromCenterAndRadius(
new Position(17.3660, 78.4760), Distance.FromMiles(0.3)))
{
     IsShowingUser = true,
     HeightRequest = 100,
     WidthRequest = 960,
     VerticalOptions = LayoutOptions.FillAndExpand
 };
 var stack = new StackLayout { Spacing = 0 };
 stack.Children.Add(map);
 Content = stack;

My out put

enter image description here

here i want to display the user current location. this entire code was return in Xamarin Shared code. i'm not using Xamarin Android. can any one help me to solve this problem. Thanks in advance.

Upvotes: 0

Views: 1262

Answers (2)

kaolick
kaolick

Reputation: 4857

It's a known bug on Android. It's working fine on iOS.

Here's the link to the bug report on bugzilla.

A possible workaround would be to show a map pin instead for as long as the bug hasn't been fixed. It goes like this:

map.Pins.Add(new Pin { Label = "You are here",
                       Position = new Position(17.3660, 78.4760) });

UPDATE: This issue has been fixed on Xamarin.Forms.Maps version 1.3.0.6292.

Upvotes: 0

Steve Chadbourne
Steve Chadbourne

Reputation: 6953

Most platforms require you to request permission to get a users location via GPS.

For Android this is located in the Android Manifest (under project properties). Check both ACCESS_FINE_LOCATION and ACCESS_COURSE_LOCATION.

Upvotes: 0

Related Questions