0

I am implementing ordnance survey maps. I am able to display all annotations but didSelectAnnotationView method is not calling when tap on annotation.

Here is the code, i have used below in viewForAnnotation method.

OSAnnotationView *view = nil;
static NSString *pinAnnotation = @"PinAnnotation";
view = [self.mapView dequeueReusableAnnotationViewWithIdentifier:pinAnnotation];
if (view == nil) {
    view = [[OSAnnotationView alloc] initWithAnnotation : annotation reuseIdentifier : pinAnnotation];
}

i have set delegate to self and able to call all delegate methods except didSelectAnnotationView.

Can anyone answer this please?

Thanks

Steve Gear
  • 757
  • 2
  • 16
  • 44

1 Answers1

0

I had a look at OSAnnotationView's documentation and saw that it has an image property. Try setting it to something non-nil and I think didSelectAnnotationView will work then. Also, try setting its title property to an empty string, if the setting the image property to non-nil doesn't work.

  • Kunal Shrivastava thanks for the reply. I have tried setting image property as view.image = [UIImage imageNamed:@""]; but does bot work for me and title property is not found. – Steve Gear Jul 26 '16 at 18:37
  • In the demo project for OSMapView, I saw that they use OSPinAnnotationView in the viewForAnnotation while in your code you use OSAnnotationView. Could this be a problem? Can you try using OSPinAnnotationView instead? – Kunal Shrivastava Jul 27 '16 at 02:17
  • Even use OSPinAnnotationView in viewForAnnotation doesn't work, delegate method is not calling. – Steve Gear Jul 27 '16 at 08:57