how to get country location on Google Map in iphone using Country name only? - iphone

In my iphone application i have integrated Google Map.I want to show the country location on Google map using only country Name Only.(Not needed to use its latitude and longitude).The input only will be the country name?(i.e India) to the google Map and Map will locate it with indicate pinpoint.
Is it possible to locate the country using the country name in google Map?
Is any body has any solutuion or code snippet or any useful link,which would be appreciated.
Thanks,
Mishal Shah

There is no geocoder in the iPhone SDK at this time. You'll have to use a library likes http://developers.cloudmade.com/wiki/iphone-api/Geocoding_iPhone_example or call Google geocoder API, Yahoo etc.

Related

Reverse GeoCode in Asia

in my flutter app I use the package here_maps_webservice (v1.0.3) for reverse-geocoding. It works very well for european addresses. But for latitudes and longitudes in China, I get just the country name: People's republic of China.
Is it not yet possible to get more details for positions in China/Asia?
Xinyu
Mobile SDK including Flutter SDK does not support for China(main land).
Please see below coverage information.
Coverage Information
https://developer.here.com/documentation/flutter-sdk-navigate/4.8.0.0/dev_guide/topics/coverage-information.html
Places and Search / Geocoding / Reverse Geocoding
https://developer.here.com/documentation/geocoding-search-api/dev_guide/topics/search-local-coverage.html

How to display nearby locations using Google Places API as a list (without a map) for a flutter project?

I'm building a flutter app which should show the nearby locations of the user as a list. I have used locations plugin to find the user's location, which now returns latitude and longitude.
Is it possible using this information (lat & long) to show the nearby locations as a list, not using a map?
Sure. You can use Google Places API :
Use location property to pass lat and long.
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&key=YOUR_API_KEY
Yes its possible, use Google Places API
https://developers.google.com/places/web-service/search
Use location property to pass lat lng as suggested in the documentation link provided.

To get latitude and longitude from user given location

In my app the user gives the location name for eg: "New York". in the text field, app gives the location ie latitude & longitude of New York.
Which method I should use . please help me.
Thanks.
You can use this Google Geocoding API below,
http://maps.googleapis.com/maps/api/geocode/json?address=Winnetka&sensor=false
In the place of address=Winnetka you can write address= New York,
You will get the lat and long in the xml responce so just parse the output.
Enjoy!
You can also use the Places Autocomplete API, which you may find useful.

Google Geocoding API not returning correct latitudes,longitudes for address as returns in google maps

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!
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.

How can I find a city and show it on a MKMapView?

I'm developing an iPhone application to search cities on a MKMapView. The user specify a city and then it show its location on a MKMapView. Is that possible?
Thanks.
EDIT: iOS 5 now includes CLGeocoder, which will do just that for you.
You could use Google's Geocoder REST API. A request looks like this:
http://maps.google.com/maps/api/geocode/json?address=city&sensor=true_or_false
Since the response is in JSON format, you'll need a JSON parser.