Bing Maps API Web Control,选择了哪些方向?

时间:2018-03-01 23:21:19

标签: bing-maps bing-api

使用bing maps API Web Control v8的DirectionsManager,如果显示多条路线,如何判断选择了哪些方向?是否有一件我似乎无法找到的事件?或者也许我可以从directionsManager对象获得一些东西?

谢谢!

1 个答案:

答案 0 :(得分:1)

使用update事件和getCurrentRoute函数:

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.
});