In the app I'm currently designing I have a MKMapView
with overlays on it (customized MKPolylines
btw) and I would like to be able to detect touch events on these overlays and assign a specific action to each overlay. Could any one help me on this one ?
Thanks !
Benja
Just in case it might help some of you... I couldn't find a way to do that but I added an annotation on my overlays (Anyway, i needed to do that to display some information) and then I could get the touch event on this annotation. I know it is not the best way to do it but in my situation, and maybe yours, it works ;) !
This can be solved combining How to intercept touches events on a MKMapView or UIWebView objects? and How to determine if an annotation is inside of MKPolygonView (iOS). Add this in viewWillAppear:
WildcardGestureRecognizer
is in the first linked answer. CallingmapView:viewForOverlay:
won't be cheap, adding a local cache of those would help.