Finding and Mapping a Route in Windows Phone 8

One of the really cool and powerful things in the Windows Phone mapping services is the ability to simple hand the Windows Phone APIs a list of geo coordinates and have it create walking or driving route on the fly. Because of the power of offline mapping in Windows Phone 8, this means that developers can create extremely powerful directional software that works even when the phone doesn’t have network connectivity.

The first thing we need to do is set up a map control on which to display our resulting route.

The result will be a Route object that gives an estimated duration for travelling the route as well as an enormous amount of detailed data about how to get from point A to point B (and then, subsequently, points C, D, and E). The instructions between each point are kept in the Legs property of the Route and each leg has every street and every turn detailed in the Maneuvers property. It’s really easy to work with.

But even better than that is the fact adding the route to your map is only 1 line of code (but I like to use 3 to make things easier):