【问题标题】:More than 2 Origin and destination on Google Maps API 3Google Maps API 3 上超过 2 个起点和终点
【发布时间】:2012-10-07 05:01:49
【问题描述】:

我有这个例子:

https://google-developers.appspot.com/maps/documentation/javascript/examples/directions-panel

我想知道如何通过 2 个或更多航点设置路线?正如您在该应用程序上所知道的,您可以获得航路点:首先,设置起点/起点,然后设置目的地点,地图将生成路线。脚本:

      function calcRoute() {
    var start = document.getElementById('start').value;
    var end = document.getElementById('end').value;
    var request = {
      origin: start,
      destination: end,
      travelMode: google.maps.DirectionsTravelMode.DRIVING
    };
    directionsService.route(request, function(response, status) {
      if (status == google.maps.DirectionsStatus.OK) {
        directionsDisplay.setDirections(response);
      }
    });
  }

参见:起点:起点,终点:终点。

现在的问题是:我可以自己设置航点吗?点对点使用 LatLong,或者我只是说一下街道名称是什么意思?

明白吗?对不起,我不善言辞,但我一直在等待答案,谢谢!

【问题讨论】:

    标签: google-maps google-api


    【解决方案1】:

    【讨论】:

    • 你是这个意思吗? :来源:“1521 NW 54th St, Seattle, WA 98107”
    猜你喜欢
    • 2016-09-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-20
    • 1970-01-01
    • 2017-07-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多