【发布时间】:2013-02-22 10:15:21
【问题描述】:
如何为用户位置变化添加监听器 google maps sdk for iOS?
【问题讨论】:
如何为用户位置变化添加监听器 google maps sdk for iOS?
【问题讨论】:
您好,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
【讨论】:
更新:此答案不正确,请参阅罗伯特的答案。
Google Maps SDK for iOS 中似乎没有任何内容可以在用户位置更改时通知您。
因此您需要自己使用核心位置(CLLocationManager 类)来监听位置变化。
【讨论】: