0

In my application i have added a google maps on my view.

I want to know the touch point on the mapView / myView, where did i taped

So that i implemented logic as follows.

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    CGPoint touchPoint  = [[touches anyObject] locationInView:mapView_];
     CGPoint touchPoint2  = [[touches anyObject] locationInView:self.view];



    NSLog(@"========== %@", NSStringFromCGPoint(touchPoint));
    NSLog(@"========== %@", NSStringFromCGPoint(touchPoint2));

   //UITouch *touch = [[event allTouches] anyObject];
     //CGPoint touchPoint = [touch locationInView:touch.view];

}

But it works only for the first touch, from the next touch event this method doesn't calls.

I didn't get what was the problem is

user2732294
  • 641
  • 2
  • 10
  • 21
  • i've tried this code only and surprisingly it calls each and every time i touch inside view at any point and logs the value perfectly – D-eptdeveloper Sep 03 '13 at 05:38
  • yes it works for all other views very well.. but, not in my current view which is having google map view – user2732294 Sep 03 '13 at 06:17

2 Answers2

0

You can't get the touch loctaion on a map,when we touch it ,it becomes zoom,the touch events is on the UIView

0

with the help of this i get a log at everytime i touch on mapview with exact touch points

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    CGPoint touchPoint  = [[touches anyObject] locationInView:self.viewMap];
    NSLog(@"==========1 %@", NSStringFromCGPoint(touchPoint));
}
D-eptdeveloper
  • 2,430
  • 1
  • 16
  • 30