I am having a strange problem with grabbing drag / pan gestures in GMSMapView using a gesture recognizer. This problem only occurred after upgrading from GMS 1.2 to 1.3.1, where (citing documentation ),
When using GMSMapView more aggressively consumed [/ p>
I have a UIViewController with a GMSMapView under its main view. I found that GMSMapDelegate does not provide methods for handling drag / pan gestures, so I added a UIPanGestureRecognizer to the UIViewController, linked it to the IBAction selector and set the link to the output and output assembly according to the screenshot given here: http: //i.stack .imgur.com / gktoa.png
Thus, any drag and drop action simply triggers the recognizeDragOnMap: selector, as shown below:
-(IBAction)recognizeDragOnMap:(id)sender { NSLog(@"recognizeDragOnMap"); UIGestureRecognizer *gestureRecognizer = (UIGestureRecognizer *)sender; if (gestureRecognizer.state != UIGestureRecognizerStateEnded) { NSLog(@"Still dragging"); return; } NSLog(@"DragEnded"); GMSCameraPosition *position; if ((position = self.mapView.camera)) { self.automaticCameraPositionChange = NO; CLLocationCoordinate2D coordinate = [position targetAsCoordinate]; CLLocation *location = [[CLLocation alloc] initWithLatitude:coordinate.latitude longitude:coordinate.longitude]; [self.origin dragPinToLocation:location]; } else { NSLog(@"No map camera"); } }
This setting works fine under GMS 1.2.0. After the update, GMSMapView responds to the same gestures as before, but the method above is never called!
Does anyone know what and how to fix it?
source share