I use this code for opening maps app
NSString* versionNum = [[UIDevice currentDevice] systemVersion];
NSString *nativeMapScheme = @"maps.apple.com";
if ([versionNum compare:@"6.0" options:NSNumericSearch] == NSOrderedAscending){
nativeMapScheme = @"maps.google.com";
}
NSString* url = [NSString stringWithFormat:@"http://%@/maps?ll=%f,%f", nativeMapScheme, 40.739490, -73.991154];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
Seems it works good, but there is no pin on this location I use. How to add pin, I suppose there is additional parameters in request?
GPS coordinates are often used by hobbyists, surveyors, outdoor enthusiasts, and for many other purposes, which gives this approach a more technical lean than simply sharing a location through the Maps apps on iPhone directly, since raw GPS coordinates can be used by not only iPhone as well as Android but also the vast ...
Get the coordinates of a placeTouch and hold an area of the map that isn't labeled to drop a red pin. At the bottom, tap Dropped pin to find the coordinates.
If you want the pin to be placed on Apple's Maps app, use a 'q' instead of 'll' in the URL.
You can Use like this
NSString* url = [NSString stringWithFormat:@"http://%@/maps?q=%f,%f", nativeMapScheme, 40.739490, -73.991154];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With