I’m trying to send an address from an iOS app to an email recipient. I would like that address to link to a Google Map search in Safari/browser
Here’s what I have so far. I’m wondering how to use the address to search through the map:
NSString *myUrl = [NSString stringWithFormat:@"https://maps.google.co.uk/%@", addressLb.text];
NSString *emailBody = [NSString stringWithFormat:@"I'm at %@ on %@. Come join me... %@", nameLb.text, addressLb.text, myUrl];
one problem I’m having is that the address in addressLB.text has spacing. so, NSString *myUrl = [NSString stringWithFormat:@"maps.google.co.uk/?q=%@";, addressLb.text]; will search for maps.google.co.uk/?q=1600 and drop the Pennsylvania
thanks for any help
Add /maps?q= followed by the address using a plus (+) in place of spaces to the end of the google maps url. For example, to find 1600 Pennsylvania Avenue, Washington, DC:
https://maps.google.com/maps?q=1600+Pennsylvania+Avenue,+Washington,+DC