OGeek|极客世界-中国程序员成长平台

标题: ios - 谷歌地图中的didUpdateUserLocation? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 10:04
标题: ios - 谷歌地图中的didUpdateUserLocation?

我正在使用 Storyboard和 Google map 构建 iOS 应用。使用iOS6——苹果 map 有方法

-(void)mapViewMKMapView*)mapView didUpdateUserLocationMKUserLocation *)userLocation { }

查看在线文档和 xCode 中的 googleMaps.framework 我没有找到任何类似方法的线索。

我想要做的是当用户到达 map 上的标记时 - 让用户知道他们到达了那个目的地。

谷歌地图中是否存在上述方法?和/或我需要做什么来实现我之前所说的。

任何关于此问题的指导将不胜感激,在此先感谢!



Best Answer-推荐答案


GMSMapView 类有一个myLocation 属性,您可以在用户位置移动时观察该属性的变化。有关详细信息,请参阅此问题:

about positioning myself,some problems

另一种研究方法是 startMonitoringForRegion: 方法,当用户在区域内移动时(例如,靠近目标标记),您可以使用该方法接收通知:

http://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html#//apple_ref/occ/instm/CLLocationManager/startMonitoringForRegion :

关于ios - 谷歌地图中的didUpdateUserLocation?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15857281/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4