Search code examples
c#windows-phonewindows-phone-8windows-phone-8-emulator

Windows Phone 8 Geolocator returns fake location on emulator


I've tried to show my location in xaml windows phone 8 app. But always when I try to find my current location I get the fake microsoft location, even with the default maps app. For example, this code above always return same latitude and longitude:

Geolocator locator = new Geolocator();
locator.DesiredAccuracy = PositionAccuracy.High;
Geoposition position = await locator.GetGeopositionAsync();
LatitudeValue.Text = position.Coordinate.Latitude.ToString("0.00");
LongitudeValue.Text = position.Coordinate.Longitude.ToString("0.00");

Solution

  • The Windows Phone 8 emulator has a little toolbar on the top right. The bottom button is a double chevron (like ">>") - if you click it it brings up "Additional Tools", and one of the tabs is "Location". You can double-click on the map to set your location in the emulator, and you can also record and play back a travelled route.