在Google-maps-v3方向API中传递LatLng值



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

访问此链接:谷歌地图行驶方向源代码的例子?

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

你应该能够使用一个新的谷歌纬度/液化天然气对。例如:

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

最新更新