【问题标题】:How to add listener for user location google maps sdk for iOS如何为 iOS 的用户位置谷歌地图 SDK 添加监听器
【发布时间】:2013-02-22 10:15:21
【问题描述】:

如何为用户位置变化添加监听器 google maps sdk for iOS?

【问题讨论】:

    标签: google-maps-sdk-ios


    【解决方案1】:

    您好,Google Maps SDK for iOS 在 GMSMapView 类中提供了一个可观察的属性 myLocation。

    /**
     * If My Location is enabled, reveals where the user location dot is being
     * drawn. If it is disabled, or it is enabled but no location data is available,
     * this will be nil.  This property is observable using KVO.
     */
    @property (nonatomic, strong, readonly) CLLocation *myLocation;
    

    有关更多信息,请参阅我的回答: about positioning myself,some problems

    【讨论】:

      【解决方案2】:

      更新:此答案不正确,请参阅罗伯特的答案。

      Google Maps SDK for iOS 中似乎没有任何内容可以在用户位置更改时通知您。

      因此您需要自己使用核心位置(CLLocationManager 类)来监听位置变化。

      【讨论】:

        猜你喜欢
        • 2016-04-30
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-02-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多