【问题标题】:CLGeoCoder doesnot return the exact data for the current locationCLGeoCoder 不返回当前位置的准确数据
【发布时间】:2014-03-14 22:10:28
【问题描述】:

在模拟器中,我将位置设置为

Latitude: 38.056709
Longitude: -78.6115

但返回的地标是弗吉尼亚的。

CLGeocoder *geocoder = [[CLGeocoder alloc] init];

[geocoder reverseGeocodeLocation: APP_DELEGATE.userLocation completionHandler:^(NSArray *placemarks, NSError *error)
{
    if([placemarks count] > 0)
    {
        CLPlacemark *placemark = [placemarks objectAtIndex:0];
        NSLog(@"placemark --- %@",placemark);
    }
}];

App.userlocation”是我更新locationmanager后得到的位置

这是我在控制台中得到的:

placemark ----
{
    City = "Charlottesville";
    Country = "United States";
    CountryCode = US;
    FormattedAddressLines = ("704 Grassmere Rd",
                             "Charlottesville",
                             "VA 22903-9214",
                             "United States");

    Name = "704 Grassmere Rd";
    PostCodeExtension = 9214;
    State = "Virginia";
    Street = "704 Grassmere Rd";
    SubAdministrativeArea = "Albemarle";
    SubLocality = "Samuel Miller";
    SubThoroughfare = 704;
    Thoroughfare = "Grassmere Rd";
    ZIP = 22903;
}

【问题讨论】:

  • 您的具体问题是什么?
  • @Volker 我设置的位置是哥伦比亚特区,但返回的是弗吉尼亚
  • 地标适合坐标,刚刚在地图应用中检查

标签: ios objective-c core-location cllocationmanager


【解决方案1】:

检查你的坐标,这就是谷歌地图对你的坐标所说的:

Latitude: 38.056709
Longitude: -78.6115

CLGeocoder 实际上是正确的,因为这些坐标点在弗吉尼亚州而不是哥伦比亚特区

【讨论】:

    猜你喜欢
    • 2014-02-07
    • 1970-01-01
    • 1970-01-01
    • 2015-05-30
    • 1970-01-01
    • 2021-03-21
    • 1970-01-01
    • 1970-01-01
    • 2021-04-04
    相关资源
    最近更新 更多