Displaying the Route and Itinerary
When a search completes successfully, the resulting route is displayed as a bending line on the map, connecting itinerary waypoints. A separate expandable view displays the detailed itinerary.
Recall that the MapViewModel
class’s SearchRoute
method populates the list of ItineraryItems
using the RouteCalculationResult
, as shown in the following excerpt:
Route route = calculationResult.Route;MapRoute = new MapRoute(route);var collection = new ObservableCollection<MapItineraryItem>();foreach (RouteLeg leg in route.Legs){ foreach (RouteManeuver maneuver in leg.Maneuvers) { collection.Add(new MapItineraryItem(maneuver)); }}
The MapView
presents the itinerary items in ...
Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.