CLGeocoder reverse geocode from given location

后端 未结 2 629
有刺的猬
有刺的猬 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-19 23:54

    If you use the simulator, you can debug>location>Custom Location then put in lat long to simulate a location anywhere.

    0 讨论(0)
  • 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
    });
    
    0 讨论(0)
提交回复
热议问题