当点击网格项时,我传递lat和long for source和destination并在地图上显示路线。
但每次我在[A]和[B]路线点而不是地址上看到纬度和经度。
那么如何在[A]和[B]点上显示地址而不是lat,long?
以下是我的代码。
Microsoft.Maps.loadModule('Microsoft.Maps.Directions', () => {
that.directionsManager = new Microsoft.Maps.Directions.DirectionsManager(that.map);
that.directionsManager.clearAll();
// Set Route Mode to driving
that.directionsManager.setRequestOptions({
routeMode: Microsoft.Maps.Directions.RouteMode.driving
});
that.directionsManager.setRenderOptions({
drivingPolylineOptions: {
strokeThickness: 3
}
});
const waypoint1 = new Microsoft.Maps.Directions.Waypoint({
location: new Microsoft.Maps.Location(that.truckData.currentLat, that.truckData.currentLong)
});
const waypoint2 = new Microsoft.Maps.Directions.Waypoint({
location: new Microsoft.Maps.Location(that.truckData.workLat, that.truckData.workLong)
});
that.directionsManager.addWaypoint(waypoint1);
that.directionsManager.addWaypoint(waypoint2);
that.directionsManager.calculateDirections();
答案 0 :(得分:0)
如果您想要显示其他内容而不是坐标,请将其传递到路标的地址属性中,如以下代码示例所示:https://www.bing.com/api/maps/sdkrelease/mapcontrol/isdk/directionscreatedrivingroute