How to get a url for the current location in Mapkit?

I have a view controller which loads a map, I have set the current location as default when the map loads, the question I have is, how do I get a url for this location, so that I can store it in a nsstring and use it at some other place, to add it to tweet sheet basically.


You'll want to create an URL such as,12.234

Get the users coordinates from the MKMapView current users location


or if it's the current map center you are interested in


In practice it would look like this

CLLocationCoordinate2D myCoord = mapView.userLocation.coordinate;

NSString *url = [NSString stringWithFormat:@",%f",

NSLog(@"The URL is: %@", url);

The snippet gives me the following output:

The URL is:,12.289743

The parameters for the Google Maps URL can be found through Google and has been dealt with on StackOverflow.

you must save the city and county in a string. then you can build a google link like this:

NSString *link = [NSString stringWithFormat: @",%@",city,country"];

Need Your Help