【问题标题】:Passing LatLng values in Google-maps-v3 directions API在 Google-maps-v3 方向 API 中传递 LatLng 值
【发布时间】:2014-02-17 20:37:40
【问题描述】:

如何在 Directions API by Google 的请求参数中为 Origin/Destination 参数传递 LatLng 值。

访问此链接: Google map driving direction source code for their example?

  var request = {
   origin: 'Chicago', // Here I want to add a latitude and Longitude value 
   destination: 'New York',
   travelMode: google.maps.DirectionsTravelMode.DRIVING
  };

【问题讨论】:

标签: javascript google-maps google-maps-api-3


【解决方案1】:

您应该能够使用新的 Google 纬度/经度对。例如:

origin: new google.maps.LatLng(51.2244, -12.12221)

【讨论】:

  • 我已经试过了,但是我给出了一个错误的 LatLng 值。它现在工作
猜你喜欢
  • 2011-08-23
  • 2013-11-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-02-04
  • 2014-11-17
  • 2012-11-17
相关资源
最近更新 更多