问题标签 [clgeocoder]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
iphone - 来自 geocodeAddressString 的无法识别的选择器错误处理结果
我正在尝试使用MKMapItem
不使用坐标来创建多个地标。
我直接使用了位置名称,geocodeAdressString:@"Mumbai"...
但我得到了单个位置的结果。
当我通过数组使用多个位置时,我收到了这个错误:
由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[__NSArrayI 长度]:无法识别的选择器发送到实例 0xab48380”
为什么会出现这个问题?
ios - 地图上的多个位置(使用 MKMapItem 和 CLGeocoder)
我正在尝试在 中显示多个位置MKMapItem
。我从 a 获取这些位置CLGeocoder
,不幸的是它只接受一个位置。即使我传入一个NSArray
它只返回一个位置。
以下适用于单个位置,但不适用于多个位置。如何对多个位置进行地理编码?
ios - 使用 reverseGeocodeLocation: 设置地址字符串并从方法返回
我正在尝试将起点和终点本地化为地址字符串,以便可以将其存储到NSUserDefaults
. 问题是该方法继续执行并且没有设置我的变量。
这是我的应用程序调试器显示的内容:
开始
_
例如,如果我的地址是:“Mainstreet 32, CITY”。那么我想看到的是以下内容:
开始
Mainstreet 32, CITY
Einde
问题是我的代码没有等待我CLGeocoder
完成,所以我的变量returnAddress
在返回时没有设置,它是空的。
有谁知道如何解决这个问题?
ios - 在 MKMapView 中覆盖城市、地区等
如何在城市内特定城市或地区的 MKMapView 上叠加几何图形?
我在看CLGeocoder
,MKOverlayView
和CLRegion
,但我有点困惑。
如何获取创建 MKPolygon / 叠加层的坐标?
在 Apple 的示例中,他们已经为科罗拉多州获得了 4 分。我是否必须自己从某种数据库中手动填充这些点?或者像 CLGeocoder 这样的东西可以访问给定地区/城市/州的几何形状吗?
ios - 从 CLGeocoder 获取当前城市和国家?
我一直在互联网上试图找出如何从CLGeocoder
. 我可以轻松获得经度和纬度,但我需要城市和国家/地区信息,而且我不断遇到不推荐使用的方法等,有什么想法吗?它基本上需要获取位置,然后有一个NSString
国家和NSString
城市,所以我可以用它们来查找更多信息或将它们放在标签上等。
iphone - 如何在 Iphone 中用英文获取用户所在的城市和国家
我正在使用以下代码在 Iphone 中获取用户所在的城市和国家/地区。
它可以工作,但问题是它以指定的语言返回值。例如,如果用户的当前国家/地区是阿联酋和迪拜市,那么它给我的值为 دبي 和 لإمارات 。我想用英语获得这些值,例如,迪拜和阿拉伯联合酋长国。
ios - iOS 6.1 中的人类可读位置
自 6.1 更新以来,我只能反转包含 CLLocation 信息的所有照片的前 25%。
在前 25% 之后,我得到了所有其他的:Error Domain=kCLErrorDomain Code=2 "The operation could not be completed. (kCLErrorDomain error 2.)"。
我正在处理所有图像,所以也许我太频繁地太快地调用服务?但在任何地方都没有提到这方面的限制:S
代码
谢谢!
iphone - Using CLGeocoder to find the nearest city
So I've been looking at this for a while, and I can't seem to find a solution anywhere. I am trying to use CLGeocoder
in an iOS app to find the nearest city to where the user long taps on the map. I have two main problems:
- Even if the user is very zoomed out, and the user taps on say New York (which is what they intend), because of how zoomed out the map is,
CLGeocoder
often returns a nearby city instead of the more obvious answer of New York. I can't work out how to set the "fuzziness" of the search to overcome this issue. - In many instances the
City
field is null in the returned placemark object, most commonly in remote areas such as deserts or oceans. In this case, I would ideally want to find the nearest object that actually hasCity
defined, but can't work out how to do this.
ios - 没有可用 Internet 连接时的 CLGeocoder reverseGeocodeLocation 结果
如果网络不可用,我在尝试对位置进行反向地理编码时看到奇怪的结果:
- 在 iOS 5.0.1 上看到
飞行模式开启
/li>
这没有记录;至少我找不到它。
这本身并不是什么大问题,因为我不能指望它在没有网络的情况下正确地对地址进行反向地理编码,但它会阻止我向用户显示信息性消息。
dst - 如何获取 CLLocation 的时区名称
我有一个使用 CLGeocoder 从地址字符串转发地标的应用程序。CLPlacemark 响应包含一个 CLLocation,它为我提供 GPS 坐标。
创建 NSTimeZone 的唯一方法似乎是使用正确的时区名称。需要指出的是,我没有使用设备的当前位置,因此 [NSTimeZone localTimeZone] 对我不起作用。
有没有办法获取 CLLocation 的时区名称,以便我可以正确创建 NSTimeZone?
注意:我一直在使用 timeZoneForSecondsFromGMT,但它从不包含正确的 DST 数据,所以它对我没有帮助。