gpt4 book ai didi

iphone - 从邮政编码(邮政编码)或城市/州获取坐标

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:03:20 27 4
gpt4 key购买 nike

我现在正在使用 Map Kit 和 Core Location,需要从邮政编码城市/州获取位置信息。有什么办法吗?

最佳答案

您可以使用 CLGeocoder支持将地址转换为坐标以及反向转换的类。例如:

[geocoder geocodeAddressString:@"<postcode here>"
completionHandler:^(NSArray* placemarks, NSError* error){
for (CLPlacemark* aPlacemark in placemarks)
{
// Process the placemark.
}
}];

您可能想使用多种不同的方法。例如,您可以将搜索限制在特定区域。

关于iphone - 从邮政编码(邮政编码)或城市/州获取坐标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15971875/

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