views:

807

answers:

2

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.

+3  A: 

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

ennuikiller
make sure your latitude and longitude are set properly. I use this same code in my app which works perfectly!
ennuikiller
A: 

can you help me out with an app so that all i have to do is input a .csv file for locations( lat and long) i have been looking hard and cant seem to find one. thank you.

gus