简体   繁体   中英

Windows Phone 7.1 GPS

I am trying to use a string that has a location(ie a book store read from an xml file) and then gives you directions from your current location to reach that particular book store. I am unsure as to how to do this. I believe it requires bing maps, but I am wondering if anyone has any code that performs a similar operation. Maybe you need specific coordinate points to be read in from the XML file? Thank you for your time and help!

You can rely on BingMapsDirectionsTask to accomplish that easily. Following is an example on how to show direction from current location to a book store location :

var directionTask = new BingMapsDirectionsTask();
var bookStoreCoordinate = new GeoCoordinate(Double.Parse(latitudeStringFromXml, CultureInfo.InvariantCulture),
                                            Double.Parse(longitudeStringFromXml, CultureInfo.InvariantCulture)));
directionTask.End = new LabeledMapLocation("book store name", bookStoreCoordinate);
directionTask.Show();

You can search with keyword "windows phone 7 BingMapsDirectionsTask" to get further information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM