Bing 地图 v8 - 如何在 DirectionsManager 或等效设备上重新加载已保存的路线?

Bing Maps v8 - How can I reload a saved route on a DirectionsManager, or equivalent?

我通过 DirectionsManager 绘制了一条路线,并保存了路线对象。我想在一段时间后重新加载这条路线。怎么办?

下面是路由对象保存在变量中的代码摘录:

var directionsManager;

Microsoft.Maps.loadModule('Microsoft.Maps.Directions', function () {
    directionsManager = new Microsoft.Maps.Directions.DirectionsManager(map);

    directionsManager.setRequestOptions({ 
        routeMode: Microsoft.Maps.Directions.RouteMode.driving 
    });

    Microsoft.Maps.Events.addHandler(directionsManager, 'directionsUpdated',onUpdateDirections);
});

var myRoute;

function onUpdateDirections(e) {
    myRoute = e.route;
};

Bing 地图的使用条款不允许存储路线数据。唯一可以存储的数据是地理编码数据,并且只有您拥有 Bing 地图许可证才能存储。

如果要重新加载之前显示的路线,请存储路线终点和使用的选项。如果路线使用实时交通并且您想显示基于 的路线,您也可以存储日期和时间并在您的请求中使用它。