CLGeocoder reverse geocode from given location

后端 未结 2 632
有刺的猬
有刺的猬 2021-01-19 23:10

Given a longitude and latitude not my current location how can I perform a reverse geocode lookup using GLGeocoder?

self.geoCod         


        
2条回答
  •  醉话见心
    2021-01-20 00:00

    I never tried this, but can't you create your own CLLocation object?

    If you know current longitude and latitude you can -

    CLLocation *location = [[CLLocation alloc]initWithLatitude:someValue longitude:someValue];
    [self.geoCoder reverseGeocodeLocation: location completionHandler: ^(NSArray *placemarks, NSError *error) {
        //do something
    });
    

提交回复
热议问题