Reputation: 6294
I am developing a game in which the user has to select a country on a world map.
I was thus wondering:
what's the best approach to show an interactive map? I found this framework/component on the Web http://mousebird.github.com/WhirlyGlobe/ but I am also evaluating MapKit, MapBox and Google Maps frameworks. In your opinion and from your own experience, what would be the best choice?
Given some GPS coordinates, how can I retrieve the country name? (I'm interested only in the country name, nothing more)
Is there any sample code or tutorial in which such an application is implemented?
Thanks!
Upvotes: 2
Views: 3788
Reputation: 1042
In Google Map SDK for iOS You have to try with this Delegate Method.
It is giving you coordinate where user tapped.
- (void)mapView:(GMSMapView *)mapView
didTapAtCoordinate:(CLLocationCoordinate2D)coordinate
{
NSLog(@"You tapped at %f,%f", coordinate.latitude, coordinate.longitude);
}
With this particular coordinates you can find country.
I think you have to check this . It will help you.
Upvotes: 3
Reputation: 5128
You should also check out MapBox. The iOS SDK supports full, configurable interactivity. There is an example app for converting a tap into the name/flag of the country tapped.
https://github.com/mapbox/mapbox-ios-example
Upvotes: 0