ios - How can i get any information like lat,long when i touch on MKMapView in iPhone/iPad? -
I now have a MapView using the xib file when I want to touch in MapView so I want latitude and longitude of that particular area. Any whey or any sample code that helps me in this work. Thanks in advance. After IOS 3.2 or greater, it is probably better and easier to use a Before> instead it is trying to subclass and with a view to putting the map barrier manually touches, Map Add point identifier to view: Next, apply Finally, pointing apply handler: With UIGestureRecognizer
UITapGestureRecognizer * Tgr = [[UITapGestureRecognizer alloc] initWithTarget: Self-action: @Selector (TapGestreHandler :)]; Tgr.delegate = self; // Add also & lt; UIGestureRecognizerDelegate & gt; [MapView addGestureRecognizer: tgr] for @diff; [TRG release];
shouldRecognizeSimultaneouslyWithGestureRecognizer to return
Yes that can work in your tap gesture recognizer at the same time (the map otherwise by pins map as taps will not be handled automatically):
- (bool) gestureRecognizer: (UIGestureRecognizer *) gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer: (UIGestureRecognizer *) otherGestureRecognizer {return YES; }
- (minus) tapGestureHandler: (UITapGestureRecognizer *) tgr {CGPoint link = [tgr locationInView: MapView]; CLLocationCoordinate2D TouchMapside = [mapView ConvertPoint: TouchPoint to Coordinated Frameview: MapView]; Anselog (@ "tap Jisterhandlr: Tcmap Kurodinet =% f,% f", Tcmap Kurodinetklatidud, Tcmap Coordinet. Lame); }
Comments
Post a Comment