Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

DirectionsManager class

Bing

Contains methods and properties for calculating and displaying route directions.

Public Methods

Name Definition Return Type Description

CalculateDirectionsAsync

CalculateDirectionsAsync()

IAsyncOperation<RouteResponse>

Makes an asynchronous request for route directions based on the set directions request and directions render options.

ClearActiveRoute

ClearActiveRoute()

None

Clears the current route.

GetManeuverSymbol

GetManeuverSymbol(string maneuverType)

string

Returns a description of the symbol used to represent the specified maneuver type.

GetMap

GetMap()

Map

Returns the map on which to display the route.

HideRoutePath

HideRoutePath( Route route)

None

Hides the specified route.

ShowDisambiguationPushpins

ShowDisambiguationPushpins()

None

Displays disambiguation pushpins for the route stops on the map. If there is more than one disambiguated waypoint, show pushpins for the first waypoint.

ShowRoutePath

ShowRoutePath( Route route)

None

Displays the specified route on the map.

Properties

Name Type Description

ActiveItineraryItem

ItineraryItem

Gets or sets the active itinerary item.

ActiveRoute

Route

Gets or sets the active route.

DirectionsInputView

DirectionsInput

Gets or sets the directions input panel, which is used to set the directions request options.

RenderOptions

DirectionsRenderOptions

Gets or sets the options used to specify how to display the route on the map.

RequestOptions

DirectionsRequestOptions

Gets or sets the route calculation request options.

RouteResult

RouteCollection

Gets the result of the current route calculation request.

RouteSummaryView

RouteSummary

Gets the route summary.

UIEventManager

DirectionsUIEventManager

Gets or sets the event manager for the directions UI.

Waypoints

WaypointCollection

Gets or sets a collection containing the route waypoints, which includes the route start point, the route end point, and any stops in between.

Events

Name Arguments Description

ActiveRouteChanged

DirectionsEventArgs

Occurs when the active route changes.

Code Example

        public async void GetDirections()
        {
            // Set the start and end waypoints
            Bing.Maps.Directions.Waypoint startWaypoint = new Bing.Maps.Directions.Waypoint("Seattle, WA");
            Bing.Maps.Directions.Waypoint endWaypoint = new Bing.Maps.Directions.Waypoint("Portland, OR");

            Bing.Maps.Directions.WaypointCollection waypoints = new Bing.Maps.Directions.WaypointCollection();
            waypoints.Add(startWaypoint);
            waypoints.Add(endWaypoint);

            Bing.Maps.Directions.DirectionsManager directionsManager = myMap.DirectionsManager;
            directionsManager.Waypoints = waypoints;

            // Calculate route directions
            Bing.Maps.Directions.RouteResponse response = await directionsManager.CalculateDirectionsAsync();

            // Display the route on the map
            directionsManager.ShowRoutePath(response.Routes[0]);


        }
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.