c# - Call Navigation/Maps/Drive with an Address in WP8.1 Application -


i wondering if it's possible call default navigation application within windows phone 8.1 application. have address , user press button , able navigate address through default navigation app. if possible, how do it?

thanks time,

johan

you can launch turn-by-turn directions apps using ms-drive-to , ms-walk-to schemes (depending on type of directions want) first need geocoordinate address have. since you're targeting windows phone 8.1, can use maplocationfinder class in windows.services.maps namespace.

string locationname = "empire state building"; string address = "350 5th avenue, new york city, new york 10018";  var locfinderresult = await maplocationfinder.findlocationsasync(     address, new geopoint(new basicgeoposition()));  // add error checking here  var geopos = locfinderresult.locations[0].point.position;  var drivetouri = new uri(string.format(      "ms-drive-to:?destination.latitude={0}&destination.longitude={1}&destination.name={2}",       geopos.latitude,       geopos.longitude,       locationname));  launcher.launchuriasync(drivetouri);                     

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -