O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Showing Directions with the Built-In Maps App

In addition to displaying a single point using the built-in Maps app, you can also display a route. The MapsDirectionsTask class allows you to specify a start and end point for the route, as shown in the following example:

MapsDirectionsTask mapsDirectionsTask = new MapsDirectionsTask();GeoCoordinate startCoordinate = new GeoCoordinate(47.635, -122.362);mapsDirectionsTask.Start           = new LabeledMapLocation("Start Point", startCoordinate);GeoCoordinate endCoordinate = new GeoCoordinate(47.650, -122.349);mapsDirectionsTask.End = new LabeledMapLocation("End Point", endCoordinate);mapsDirectionsTask.Show();

Note

If you do not specify a Start value for the MapsDirectionsTask ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required