c# - Geolocator hanging on WP8, working on 8.1? -
c# - Geolocator hanging on WP8, working on 8.1? -
geolocator seems not work on wp8 when should. (but unusual reason works fine on 8.1)... i'm in optimal conditions - lte, fios wifi... no obstructions. no reason why shouldn't work. however, seems hang , never homecoming current location or exeption.
i have tried disable reverse geocode , not work. i've narrowed downwards beingness actual service gets location (geolocator or geoposition)
id_cap_location enabled. phone location services enabled. i'm targeting wp8.
code:
private async void getlocation()         {              seek             {                 geolocator gl = new geolocator(); gl.desiredaccuracyinmeters = 50;                  geoposition geoposition = await gl.getgeopositionasync(maximumage: timespan.fromminutes(5), timeout: timespan.fromseconds(60));                 latitude = geoposition.coordinate.latitude.tostring(); longitude = geoposition.coordinate.longitude.tostring();                  //location physical address                 list<maplocation> locations;                 reversegeocodequery query = new reversegeocodequery();                 query.geocoordinate = new geocoordinate(geoposition.coordinate.latitude, geoposition.coordinate.longitude);                  //set address tecxtblock                 query.querycompleted += (s, e) =>                 {                     locations = e.result list<maplocation>;                     address = locations[0].information.address.city.tostring();                     ts.center = new geocoordinate(geoposition.coordinate.latitude, geoposition.coordinate.longitude);                     ts.zoomlevel = 7;                     location.text = address.toupper(); //location                      //successful, weather current location                     getforecast();                 };                 query.queryasync();             }              grab             {                 messagebox.show("location services appear turned off.  utilize atmosphere, turn location services on.");             }         }       
i've encountered issues on wp8 background tracking update the position when app bought foreground. confusing knew working on other devices without issue.
in end un-installed app , re-installed, solved issue. in case haven't tried - remove app , re-install / re-deploy using visual studio. issue might resolve itself.
 c# windows-phone-8 geolocation 
 
Comments
Post a Comment