gpt4 book ai didi

ios - CLGeoCoder 不返回当前位置的确切数据

转载 作者:行者123 更新时间:2023-11-29 03:09:12 24 4
gpt4 key购买 nike

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

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;
}

最佳答案

检查您的坐标,这就是 Google map 对您坐标的说明:

Latitude: 38.056709
Longitude: -78.6115

enter image description here

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

关于ios - CLGeoCoder 不返回当前位置的确切数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22402138/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com