Bing Map Route API:路由点显示lat,long not address

时间:2018-06-07 19:16:18

标签: bing-maps

当点击网格项时,我传递lat和long for source和destination并在地图上显示路线。

但每次我在[A]和[B]路线点而不是地址上看到纬度和经度。

那么如何在[A]和[B]点上显示地址而不是lat,long?

enter image description here

以下是我的代码。

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();

1 个答案:

答案 0 :(得分:0)

如果您想要显示其他内容而不是坐标,请将其传递到路标的地址属性中,如以下代码示例所示:https://www.bing.com/api/maps/sdkrelease/mapcontrol/isdk/directionscreatedrivingroute