场地的 Google 地图地理编码器
我正在寻找一种使用谷歌地图对场地进行地理编码的方法。 Geocoder API 仅提供使用地址进行地理编码的功能。但是,如果不知道地址,只知道城市和餐厅名称怎么办?或者我想检索“Mc Donalds Berlin”或“Bar Berlin”的结果?
我发现这篇文章他准确地询问了我的需要:Google 中的建议列表地图搜索输入
这有效非常好,而且速度快得令人难以置信!我查看了源代码,发现他正在使用以下网址:
http://maps-api-ssl.google.com/maps/suggest?hl=en&gl=us&v=2& json=b&auth=4c8b041euWw4-3h2-Ty2fD3D1BKVQqJCEcU&src=1,2&num=5&numps=5&callback=handleResponse&q=........
顺便说一句,它是相同的 URL maps.google.com
用于获取 ajax 自动完成功能。
我现在的问题是:
- 我自己的网站是否可以使用此 URL?
- 我需要特殊的 API 密钥吗? (因为上面 URL 中的 auth= var)
- 或者它是否像付费服务?
- 还有其他方法可以解决问题吗?例如,使用 google 的标准 Geocoder API?
I'm searching for a way to geocode venues with google maps. The Geocoder API only provides the ability to use addresses for geocoding. But what if don't know the address and only the city and the name of the restaurant? Or I want to retrieve results for "Mc Donalds Berlin" or just "Bar Berlin"?
I've found this post where he asks exactly what I need: Suggest list in google maps search input
And at his blog I found a solution
This works very well and its incredible fast! I've checked out the source code and saw that he is using this URL:
http://maps-api-ssl.google.com/maps/suggest?hl=en&gl=us&v=2&json=b&auth=4c8b041euWw4-3h2-Ty2fD3D1BKVQqJCEcU&src=1,2&num=5&numps=5&callback=handleResponse&q=........
Btw, it's the same URL that maps.google.com
uses to get their ajax autocompletion.
My questions now are:
- Is it allowed to use this URL for my own website?
- Do I need a special API key? (because of the auth= var in the URL above)
- Or is it sth like a paid service?
- Are there any other ways to get the problem solved? e.g. with the standard Geocoder API from google?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要查看适用于场地的 Google Places API:
Google Places API< /a>
另一种方法是通过 YQL,但我不能 100% 确定它的准确性。转到 YQL 控制台 并尝试以下查询:
这将为您提供亚特兰大 Outback 牛排馆的位置,GA。您还可以查询邮政编码附近的餐馆:
我确信有一些方法可以使用 YQL 查询给定点周围的场所。
You might want to take a look into Google Places API for Venues:
Google Places API
Another way to do it is through YQL, but i am not 100% sure on the accuracy of it. Go to YQL Console and try the following query:
This would give you locations of Outback steakhouse in Atlanta, GA. Also you can query resturants near a zipcode:
I am sure there are ways to query venues around a given point using YQL.