我将为路线的方向构建自己的样式,但只有当我使用带有setRenderOptions
属性的itineraryContainer
方法时,我才能使用回调函数访问DirectionSteps
( afterStepRender
事件)。
var directionsManager = new Microsoft.Maps.Directions.DirectionsManager(map);
// ...
directionsManager.setRenderOptions({ itineraryContainer: document.getElementById('itineraryDiv') });
是否有可能使用所有DirectionSteps 获取Object而不使用呈现隐藏的html元素中的步骤?
答案 0 :(得分:0)
解决方案是使用Bing地图中的网址模板,请参阅文档:http://msdn.microsoft.com/en-us/library/ff701717.aspx
http://dev.virtualearth.net/REST/v1/Routes?wayPoint.1=wayPoint1&viaWaypoint.2=viaWaypoint2&waypoint.3=wayPoint3&wayPoint.n=wayPointn&heading=heading&optimize=optimize&avoid=avoidOptions&distanceBeforeFirstTurn=distanceBeforeFirstTurn&maxSolutions=maxSolutions&routePathOutput=routePathOutput&tolerances=tolerance1,tolerance2,tolerancen&distanceUnit=distanceUnit&key=BingMapsKey