sagarkothari
sagarkothari

Reputation: 24810

Google maps in iPhone - city & State name by Longitude & Latitude

I have developed an application in which the data About Schools are stored in ASP.NET Web Server.

The database has following values.

=>School Name => Longitude of School => Latitude of School.

Now, I retrieve all the data in iPhone through web-service & NSURLRequest.

Now, Following is my Problem.

When user Clicks on a school ( in tableView ).

Google map should be load - ( i can do that )

A pin should be dropped at the place - ( i can do that )

A pin title should be with City & State name - ( i can't do )

Thanks in advance for helping me.

Upvotes: 1

Views: 2879

Answers (1)

ennuikiller
ennuikiller

Reputation: 46965

You can get both the city and state name by querying this web service:

NSString *nameString = [NSString stringWithFormat:@"http://ws.geonames.org/findNearestAddress?lat=%f&lng=%f",latitude,longitude];

This will return the full nearest address in xml format with you can then parse to get city ans state information

Upvotes: 2

Related Questions