【问题标题】:Best way to get free driving instructions获得免费驾驶指导的最佳方式
【发布时间】:2009-03-23 11:13:28
【问题描述】:

有没有简单的方法来获取驾驶指示?

类似于:我调用“http://someservice/?start=NYC&target=Washington”然后服务返回一个包含路由信息的 XML 文件?

有没有人尝试过从独立的桌面应用程序访问这种基于 Web 的服务?

任何帮助将不胜感激!

更新:感谢您的提示,但不幸的是我无法运行 JavaScript。是否还有可能收到驾驶指示?

【问题讨论】:

    标签: java maps driving-directions


    【解决方案1】:

    你看过Google Maps API吗?

    另请参阅如何Add Google Maps’ Directions to Your Site

    【讨论】:

      【解决方案2】:

      Google maps API.

      来自Directions doc的例子:

      // Create a directions object and register a map and DIV to hold the 
      // resulting computed directions
      
      var map;
      var directionsPanel;
      var directions;
      
      function initialize() {
        map = new GMap2(document.getElementById("map_canvas"));
        directionsPanel = document.getElementById("my_textual_div");
        map.setCenter(new GLatLng(49.496675,-102.65625), 3);
        directions = new GDirections(map, directionsPanel);
        directions.load("from: 500 Memorial Drive, Cambridge, MA to: 4 Yawkey Way, Boston, MA 02215 (Fenway Park)");
      }
      

      【讨论】:

        【解决方案3】:

        根据您的应用程序,它可能还不是一个可行的选择,但您可能希望使用OpenStreetMap 数据查看各种路由产品。 routing wiki page 提供有关各种项目的更多信息。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2015-02-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2023-03-22
          相关资源
          最近更新 更多