Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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");
like image 598
Higor Ramos Avatar asked Dec 05 '22 13:12

Higor Ramos


1 Answers

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.

like image 145
gregstoll Avatar answered Feb 08 '23 23:02

gregstoll