iOS-网页调用百度地图API

来源:互联网 发布:淘宝店铺中心在哪里找 编辑:程序博客网 时间:2024/05/21 20:35
UIWebView *webview = [[UIWebView alloc]init];
    webview.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
    double latitude =45.748737;
    double longitude =126.699791;
    NSString *urlString =[NSString stringWithFormat:@"http://api.map.baidu.com/geocoder?location=%f,%f&coord_type=gcj02&output=html&src=gianzhong",latitude,longitude];
    NSURL *url = [NSURL URLWithString:urlString];
    NSURLRequest *request = [[NSURLRequest alloc]initWithURL:url];
    [webview loadRequest:request];
    [self.view addSubview:webview];
0 0