Closed bharathi91 closed 8 years ago
Yes, it's right. MapView handle gestures on the circle because circle selector it's part of the map. You should manually define where was make touch. I'm wrote small method for handle tap gesture on the map...
- (void)tapOnMapGestureRecognizer:(UITapGestureRecognizer *)recognizer {
CGPoint touchPoint = [recognizer locationInView:self.mapView];
CLLocationCoordinate2D coord = [self.mapView convertPoint:touchPoint toCoordinateFromView:self.mapView];
CLLocation *touchLocation = [[CLLocation alloc] initWithLatitude:coord.latitude longitude:coord.longitude];
CLLocation *selectorCenterLocation = [[CLLocation alloc] initWithLatitude:self.mapSelectorManager.circleCoordinate.latitude longitude:self.mapSelectorManager.circleCoordinate.longitude];
CLLocationDistance dist = [touchLocation distanceFromLocation:selectorCenterLocation];
NSLog(@"%@ %.2f", (dist <= self.mapSelectorManager.circleRadius ) ? @"Y" : @"N", (float)dist);
}
Did it help you solve your problem?
Thank you . I will try it and let you know the results.
How can i add touch recognition for the circle. As of now im getting touch events for long press any where on the mapView. I need to get get touches on the circle view. Can you please explain?