Google Maps API v3获取街道的起点和终点坐标 [英] Google Maps api v3 get start and end coordinates of a street

查看:116
本文介绍了Google Maps API v3获取街道的起点和终点坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想按名称突出特定的街道。我可以用街道的开始和结束坐标来做到这一点。我不想传入坐标,但要输入街道名称。 Google地图将返回街道坐标,但我需要起始和结束坐标。

  request = {
origin:街道名,
目的地:街道名,
travelMode:google.maps.TravelMode.DRIVING
};

在这个例子中,它会返回原点和目的地的相同坐标。



有什么建议吗?感谢。

解决方案

Google Maps API v3没有这样做。您需要找到不同的数据源或手动确定坐标。


I want to highlight a specific street by name. I can do this with the start and end coordinates of a street. I don't want to pass in coordinates but the street name. Google Maps will return the street coordinates but I need both start and end coordinates.

request = {
   origin: "streetname",
   destination: "streetname",
   travelMode: google.maps.TravelMode.DRIVING
};

In this example it will return the same coordinates for origin and destination.

Any suggestions? Thanks.

解决方案

The Google Maps API v3 doesn't do that. You need to find a different data source or manually determine the coordinates.

这篇关于Google Maps API v3获取街道的起点和终点坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆