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

-(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

 

你可能感兴趣的:(google地图)