Domanda

I am facing a strange problem of google geocoding API. My requirement is whenever a user types any address all the corresponding locations should show in my map View(I am using MKMap View) like it happens in google maps. So what I do is I use google geocoding API that returns me a list of latitudes and longitudes for that corresponding location.

But for some location eg:- caribou coffee, chapel hil (When I search for this location in google maps,I get a number of annotations showing that address but when I type this address in geocoding I didnt get nothing.

request url:-http://maps.googleapis.com/maps/api/geocode/xml?address=caribou%20coffee,%20chapel%20hil%20&sensor=false

response:-

-<GeocodeResponse>
<status>ZERO_RESULTS</status>
</GeocodeResponse>

Can any body tell me why I am not getting any latitude and longitude that correspnds to this address like it shown in google maps or there is some other way so that I can integrate the behaviour of google maps in my applications(mk map view).

Please help me as I am stuck here.

Any suggestions will be highly appreciated.

Thanks in advance!

È stato utile?

Soluzione

Note that the address is incomplete - e.g. searching for caribou coffee, chapel hill, nc does produce a result.

I would think that Geocoding API can't do anything with such addresses, and you may need to use some extra API - e.g. Places API (https://code.google.com/apis/maps/documentation/places/ ), which can return some results for queries like "coffee". You'd need to supply the user's location to use as a base, however.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top