Using Current Location from Location Manager in a Google Maps openURL?
<p>Been looking into this for a while today however I can't seem to get my head around how to get the users current location into a Google Maps URL to open the Google Maps app with directions populated.</p>

<p>I've taken this code from another tutorial and added it into my app. I need to get the "start" lat/lng from the below into my IBAction to open the Google Maps app.</p>

<pre><code>- (void)locationUpdate:(CLLocation *)location {
    // Lat/Lng of user (Needs to be sent to IBAction for btnDirections)
    CLLocationCoordinate2D start = { location.coordinate.latitude, location.coordinate.longitude };
}
</code></pre>

<p>The below is my IBAction for my "Get Directions" button.</p>

<pre><code>- (IBAction) onButtonClick:(id) sender {
    if(sender == btnDirections) {
        CLLocationCoordinate2D destination = { 52.48306771095311, -1.8935537338256836 };            
        NSString *googleMapsURLString = [NSString stringWithFormat:@"http://maps.google.com/?saddr=%1.6f,%1.6f&amp;daddr=%1.6f,%1.6f",
                                         newLocation.coordinate.latitude, newLocation.coordinate.longitude, destination.latitude, destination.longitude];
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:googleMapsURLString]];      
    }
}
</code></pre>

<p>I have done this previously in another app, however that view included a map showing the user location which allowed me to get the lat/lng easily.</p>

<p>Thanks in advance.</p>
