Michael Witt
Michael Witt

Reputation: 1712

Bing Maps API Web Control, Which directions are selected?

Using the bing maps API Web Control v8's DirectionsManager, how can I tell which directions have been selected if there are multiple routes displayed? Is there an event that I can't seem to find? Or maybe something that I can get from the directionsManager object?

Thanks!

Upvotes: 0

Views: 118

Answers (1)

rbrundritt
rbrundritt

Reputation: 17954

Use the update event and the getCurrentRoute function:

Microsoft.Maps.Events.addHandler(directionsManager, 'directionsUpdated', function () {
    var currentRoute = directionsManager.getCurrentRoute();

    //This will be the currently displayed route. This will fire after a route calculation or when you select an alternate route option.
});

Upvotes: 1

Related Questions