使用google地图SDK的方式总结

利用给的API进行使用google地图,主要方式有2种方式:

1,应用URL Scheme,调用google map APP,apps间的传值-->code:

if([[UIApplication sharedApplication] canOpenURL:

        [NSURL URLWithString:@"comgooglemaps://"]])

    {

        NSLog(@"can open");

       //[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"comgooglemaps://?center=31.834,117.2634&q=31.834,117.2634&zoom=14&views=traffic"]];

        

        //[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"comgooglemaps://?center=31.834,117.2634&saddr=32.834,117.2634&daddr=31.834,117.2634&&zoom=14&views=traffic"]];

        

    }else

    {

        NSLog(@"can not open.");

        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您的设备没有安装谷歌地图" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:@"现在下载", nil];

        [alert show];

        [alert release];

        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://itunes.apple.com/cn/app/google-maps/id585027354?mt=8"]];

    }

2,在本地APP调用google地图,待续。

你可能感兴趣的:(api,api,api,Google,map,map,map,map,map,Google)