问题描述:

when you go to maps.google.com and search for "cupcakes" for example, you get the results displayed on a map, and on the left there is a list of results.

I want the user of my application (iPhone and Web) to be able to enter a search term, then it searches on google and provides a list (much like the list on the left in maps.google.com), the user can then select a location from the list.

The list would need to be in XML format or something similar that can be parsed on the iPhone. It needs to include the Name of the location, a description (if provided) and its address/coordinates.

Is this possible, and if so, how can it be done?

网友答案:

You'll probably want to use the Google AJAX Search APIs, which has a different set of terms from the Geocoder. The Geocoder is for taking an address and returning a lat/long, not for things like local search. Specifically, you'll want to use local search feature. Check out the section on "Flash and other Non-Javascript Environments" for info on how to access this though a RESTful interface (for the iPhone).

网友答案:

Google provides a number of map services where you can search for locations, etc. Especially their Geocoding API may be of interest. If you use their services you are however required to show these results on Google Maps.

An alternative to Google is to use one of the free GeoNames services. They have a more relaxed set of conditions.

相关阅读:
Top