net:高德地图

//实现正向地理编码的回调函数

  • (void)onGeocodeSearchDone:(AMapGeocodeSearchRequest *)request response:(AMapGeocodeSearchResponse *)response
    {
    if(response.geocodes.count == 0)
    {
    return;
    }

    //通过AMapGeocodeSearchResponse对象处理搜索结果
    NSString *strCount = [NSString stringWithFormat:@"count: %d", response.count];
    NSString *strGeocodes = @"";
    for (AMapTip *p in response.geocodes) {
    strGeocodes = [NSString stringWithFormat:@"%@\ngeocode: %@", strGeocodes, p.description];
    }
    NSString *result = [NSString stringWithFormat:@"%@ \n %@", strCount, strGeocodes];
    NSLog(@"Geocode: %@", result);
    }

这句代码。似乎不太合适。
for (AMapTip *p in response.geocodes) {
怎么解??

1000Phone の Swift 版:
func onGeocodeSearchDone(request: AMapGeocodeSearchRequest!, response: AMapGeocodeSearchResponse!) {

    for p in response.geocodes {
        
        let tip = p as! AMapGeocode
        
        print("\(tip.location.latitude), \(tip.location.longitude)")
        
    }
    
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 136,095评论 19 139
  • 食材:油麦菜300克 香油1汤匙油泼辣子1汤匙 皇牌沙茶王1汤匙米醋1汤匙 白糖1茶匙食盐适量 纯净水适量 做法:...
    凉菜厨房阅读 2,607评论 0 0

友情链接更多精彩内容