IOS-OC-高德地图-反向地理编码 - 坐标转位置


    // 3.0 反向地理编码

 

    AMapReGeocodeSearchRequest *regeo = [[AMapReGeocodeSearchRequestalloc] init];

    regeo.location = [AMapGeoPointlocationWithLatitude:coordinate.latitudelongitude:coordinate.longitude];

    regeo.requireExtension =YES;



/* 逆地理编码回调. */

- (void)onReGeocodeSearchDone:(AMapReGeocodeSearchRequest *)request response:(AMapReGeocodeSearchResponse *)response

{

 

    if (response.regeocode !=nil )

    {

      

        NSLog(@"反向地理编码回调:%@",response.regeocode.addressComponent.neighborhood);

        NSLog(@"反向地理编码回调:%@",response.regeocode.addressComponent.adcode);

        NSLog(@"反向地理编码回调:%@",response.regeocode.addressComponent.township);

        NSLog(@"反向地理编码回调:%@",response.regeocode.addressComponent.towncode);

        NSLog(@"反向地理编码回调:%@",response.regeocode.addressComponent.district);

        

        NSArray * addressArr = response.regeocode.pois;

        if (addressArr && addressArr.count >0) {

            AMapPOI *poiTemp = addressArr[0];

            NSLog(@"反向地理编码回调:%@",poiTemp.name);

         

        }

    }


}


你可能感兴趣的:(IOS-OC,IOS-杂碎)