Try the following:
Create a global variable:
private Position _position;
Then call the ur method to get the position in the constructor. Overwrite the ur method as follows:
public async void GetPosition() { var locator = CrossGeolocator.Current; locator.DesiredAccuracy = 50; var myPosition = await locator.GetPositionAsync(); _position = new Position(myPosition.Latitude, myPosition.Longitude); }
Then do some time when you want to use this:
while(_position == new Postion(0,0)) GetPosition();
Pedro franco
source share