ios - How can i get any information like lat,long when i touch on MKMapView in iPhone/iPad? -


"postprint" itemprop = "text">

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 With UIGestureRecognizer

Before> instead it is trying to subclass and with a view to putting the map barrier manually touches, Map Add point identifier to view:

  UITapGestureRecognizer * Tgr = [[UITapGestureRecognizer alloc] initWithTarget: Self-action: @Selector (TapGestreHandler :)]; Tgr.delegate = self; // Add also & lt; UIGestureRecognizerDelegate & gt; [MapView addGestureRecognizer: tgr] for @diff; [TRG release];   

Next, apply 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; }   

Finally, pointing apply handler:

  - (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

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -