How can I get same search result as google map

让人想犯罪 __ 提交于 2020-01-15 11:08:27

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/9124927/how-can-i-get-same-search-result-as-google-map

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!