Skip to content

DevExpress-Examples/wpf-map-get-routes-to-the-destination-point-with-the-bing-map-route-data-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Map for WPF - How to Get Routes to the Destination Point with the Bing Map Route Data Service

This example demonstrates how to calculate routes to the destination point from major roads with the BingRouteDataProvider.CalculateRoutesFromMajorRoads method.

Before route calculation, specify destination point coordinates (GeoPoint.Latitude and GeoPoint.Longitude). In addition, you can specify the optional parameters: the destination name (RouteWaypoint.Description), driving or walking route travel mode using the BingRouteOptions.Mode property and route optimization options to calculate the optimal route either by time or by distance with the BingRouteOptions.RouteOptimization property.

To start the application, click the Calculate Routes From major Roads button , it handles the calculateRoutes_Click event. All parameters are passed to the CalculateMajorRoutes method, and you can see the results in the textblock element below and calculated routes on a map.

The requested results contain the total distance of a route, route leg, itinerary item ( BingRouteResult.Distance, BingRouteLeg.Distance, BingItineraryItem.Distance), the time required to follow the calculated route ( BingRouteResult.Time) and pass the rout leg and itinerary item (BingRouteLeg.Time, BingItineraryItem.Time). You can also see the maneuver instructions associated with the itinerary item (BingItineraryItem.ManeuverInstruction) and other parameters.

Note that if you run this sample as is, you will get a warning message informing that the specified Bing Maps key is invalid. To learn more how to register a Bing Maps account and create a key for it, please refer to the How to: Get a Bing Maps Key tutorial.


Files to Review

Documentation

About

This example demonstrates how to calculate routes to the destination point from major roads using the BingRouteDataProvider.CalculateRoutesFromMajorRoads method.

Topics

Resources

License

Stars

Watchers

Forks