我怎样才能得到谷歌地图相同的搜索结果 [英] How can I get same search result as google map

查看:148
本文介绍了我怎样才能得到谷歌地图相同的搜索结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在 http://maps.google.com ,google map显示10个结果...



但是当我在我的应用程序中使用google map api时,它只返回两个结果
http://maps.googleapis。 com / maps / api / geocode / xml?address = Rudy%20barber%20Shop,%20New%20York& sensor = false

现在我的问题是如何得到相同的结果。



谢谢

Mandeepd

解决方案

我认为您无法获得与Google地图完全相同的结果。 $ b Google地图是整个应用程序。它在幕后使用多种搜索引擎,有些可能不能用作API,例如中转(公共交通)指示。



您的示例请求显示您正在使用 Google Geocoding API ,用于将地址(如1600 Amphitheatre Parkway,Mountain View,CA)转换为地理坐标。这仅适用于地址,而不适用于企业。当您在地址前放置一个商业名称时,Geocoding API仍然会根据您的查询看起来像一个地址的部分,试图找出可能的位置。但是,Geocoding API并不适用于此用途。



如果您在搜索某个特定位置的商家后,也许可以使用 Google Places API(实验性),但请务必遵守其要求


When I am searching "Rudy barber Shop, New York" string in http://maps.google.com, google map showing 10 results...

But When I am using google map api in my App, It only returning two results http://maps.googleapis.com/maps/api/geocode/xml?address=Rudy%20barber%20Shop,%20New%20York&sensor=false

Now my question is that how can get the same result.

Thanks

Mandeepd

解决方案

I don't think you can get exactly the same results as in Google Maps.

Google Maps is a whole application. It uses multiple kinds of search engines behind the scenes and some may not be available as APIs, e.g. transit (public transport) directions.

Your sample request shows that you are using The Google Geocoding API which is meant for converting addresses (like "1600 Amphitheatre Parkway, Mountain View, CA") into geographic coordinates. This only works for addresses, not businesses. When you put a business name in front of the address, the Geocoding API still tries to figure out where that may be, based on the part of your query that looks like an address. However, the Geocoding API is not meant for that use.

If you are after searching businesses around a given location, maybe you could use the The Google Places API (Experimental) but make sure to comply with its Requirements.

这篇关于我怎样才能得到谷歌地图相同的搜索结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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