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

Calculating the Shortest Route Between Two Points

In the Windows Phone 8 SDK, two classes are fundamental in calculating a route: The GeocodeQuery class allows you to convert a street address to a GeoCoordinate, and the RouteQuery class finds the shortest path between two GeoCoordinates, with any number of way points in between.

The GeocodeQuery and RouteQuery class are located in the namespace Microsoft.Phone.Maps.Services.GeocodeQuery.

In the sample for this section, a custom class named RouteCalculator is used to calculate the route between two street addresses. The RouteCalculator class has a single method named CalculateAsync (see Listing 18.4).

The GeocodeQuery class has two required properties: SearchTerm and GeoCoordinate. SearchTerm ...

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