【IOS实例小计】打开google地图-web

时间:2023-08-03 09:46:38
-(void)openMaps:(id)sender{
NSString *addressText = @"1 Queen st, Auckland,NZ";
addressText = [addressText stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
NSString * urlText = [NSString stringWithFormat:@"http://maps.google.com/maps?q=%@",addressText];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlText]]; }

实现如上代码,即可;

效果:

【IOS实例小计】打开google地图-web

【IOS实例小计】打开google地图-web

参考

www.blog.sina.com.cn/s/blog_5fae23350100dmln.html