mapView:didTapMarker没有select标记
我有一个带有很多标记的GMSMapView
,每个标记代表我的客户的一个存储,每当用户接近其中一个标记(到一个商店),他得到一个通知与商店的地址。
我希望当用户点击通知(通过通知打开应用程序)时,标记将显示在地图上(已经select)。
注意:标记是每个Store
对象的属性, UILocalNotification
存储Store
对象的标识符,这就是我如何find正确的存储。
注2:我正在使用Google Maps iOS SDK
。
我试过这样做:
-(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification { NSString *storeIdentifier=[[notification userInfo] objectForKey:@"storeIdentifier"]; Store *notificationsStore=[self.monitorLocationVC storeForIdentifier:storeIdentifier]; [self.myVC mapView:self.myVC.mapView didTapMarker:notificationsStore.marker]; }
出于某种原因,用户打开应用程序时,标记未被选中。
我已经覆盖mapView: didTapMarker:
在myVC.m
像这样:
-(BOOL)mapView:(GMSMapView *)mapView didTapMarker:(GMSMarker *)marker { return NO; }
didTapMarker
在GMSMapViewDelegate
,它被地图调用来通知你的代码标记已被点击。 它不点击标记。
但是,您可以在地图视图上设置selectedMarker
,以便select该标记,并显示其信息窗口(如果有)。 例如:
self.myVC.mapView.selectedMarker = notificationsStore.marker;
有关更多示例,请参阅此处: 如何在iOS上显示信息窗口Google地图不用点击标记?
-(BOOL)mapView:(GMSMapView *)mapView didTapMarker:(GMSMarker *)marker { viewIwant.hidden=NO; //or any nib you want return YES; }
- 如何使用Google Maps ios SDK跟踪用户的位置并显示path
- iOS中没有find框架GoogleMaps sdk
- GoogleMaps基本的iOS演示程序崩溃 – 无法识别的select器发送到实例
- IOS – ObjC Google Maps API密钥
- 无法使用iOS6.1 sdk为iOS版本1.7.0创buildGoogle Maps SDK
- 在Google地图上加载标记的自定义信息窗口时,iOS应用会冻结
- 如何覆盖/ swizzle在运行时的私人类的方法objective-c?
- GoogleMapsSDK:体系结构x86_64的未定义符号
- EXC_BAD_ACCESS使用在8.3设备上运行的gmaps sdk 1.9.0,Xcode 6.4