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

问题描述 投票:0回答:1

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

谢谢!

bing-maps bing-api
1个回答
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.
});
© www.soinside.com 2019 - 2024. All rights reserved.