В приложении у меня Bing Maps API (Release Branch).Сегодня вдруг я увидел что-то не так с модулем направления.Ниже я установил опцию модулей направления, которые работали раньше, но не сейчасВ приведенном ниже коде я пытаюсь скрыть маршрут и путевые точки.Это работает для путевых точек, но не для маршрута.
Итак, я попробовал онлайн-пример SDK bing map, где я пытаюсь установить routeDraggable: false, но в примере SDK не работает.
Microsoft.Maps.loadModule('Microsoft.Maps.Directions', () => {
that.directionsManager = new Microsoft.Maps.Directions.DirectionsManager(that.map);
// Set Route Mode to driving
that.directionsManager.setRequestOptions({
routeMode: Microsoft.Maps.Directions.RouteMode.driving,
routeDraggable: false
});
that.directionsManager.setRenderOptions({
drivingPolylineOptions: {
strokeColor: 'green',
strokeThickness: 3,
visible: false
},
waypointPushpinOptions: { visible: false },
viapointPushpinOptions: { visible: false },
autoUpdateMapView: false
});
const waypoint1 = new Microsoft.Maps.Directions.Waypoint({
location: new Microsoft.Maps.Location(startLoc.latitude, startLoc.longitude), icon: ''
});
const waypoint2 = new Microsoft.Maps.Directions.Waypoint({
location: new Microsoft.Maps.Location(endLoc.latitude, endLoc.longitude)
});
this.directionsManager.addWaypoint(waypoint1);
this.directionsManager.addWaypoint(waypoint2);
// Add event handler to directions manager.
Microsoft.Maps.Events.addHandler(this.directionsManager, 'directionsUpdated', function (e) {
// const that = this;
console.log(e);
var routeIndex = e.route[0].routeLegs[0].originalRouteIndex;
var nextIndex = routeIndex;
if (e.route[0].routePath.length > routeIndex) {
nextIndex = routeIndex + 1;
}
var nextLocation = e.route[0].routePath[nextIndex];
var pin = that.map.entities.get(index);
// var bearing = that.calculateBearing(startLoc,nextLocation);
that.MovePinOnDirection(that, e.route[0].routePath, pin, truckUrl, truckIdRanId);
});
this.directionsManager.calculateDirections();
});
https://www.bing.com/api/maps/sdk/mapcontrol/isdk/directionsgetrequestoptions
![enter image description here](https://i.stack.imgur.com/wVT13.png)
@ rbrundritt Можете ли вы помочь мне в этом вопросе?