I have a map view in that I am showing annotations. On clicking any annotation the callout (bubble with info) will appear above the annotation.
What I want is to navigate to another class by clicking the callout without using CallOutForAccessory delegate method. I have added touch gesture in didselect but it still didn't work. I have looked through the Internet but didn't find any solution for the same. Most of the solutions compromise of CallOutForAccessory. Please share your ideas if anyone has done this before.
Basically what I'm wondering is how to offer the user an option to get directions in Maps from an annotation (like that little car icon inside of the annotation that opens up directions)
You can use left/right callout accessory view to add your icon and when you tap on it you can implement your direction logic.
I am using map on my IOS application. I can see the annotation on my map, and when I tap on that there is the description, which I have set. My question is whether I can have this description visible when map first loads and not make the user tap on the annotation to view it?
is that possible?
Thanks.
use an overlay instead of an annotation
I'm building an app for iPhone in which I need to customize the poped up annotation whenever the user clicks on the pin. But the point is I don't wanna use the default annotation view and I have created my own UIView (customized UIView) and whenever the user clicks on a pin, that customized view would be loaded on top of the screen.
Can someone tell me how to do it?
There a couple of solutions to this. Check out:
https://github.com/nfarina/calloutview for a nice project creating custom calloutViews.
Here has a nice writeup as well here.
i'm trying to reproduce the kind of map behavior of the app "Stuck On Earth". Here's a screenshot :
Here's the behavior :
On the map, as you can see there is pin
When you click on a pin, it display the picture attach to it. Really important : the picture stai with the pin, and it stays BEHIND it
If you click on the picture, a new controller is called
if you click on the pin, the picture disappear
I'm trying to do something similar. For now, as i can read, i've got two solutions :
Using callout : callout is HELL. I can try to use a false annotation, but MapKit deals with the depth of elements, and the picture is always in front of the pin
Using Custom Annotation : i was going for the plan of making custom annotation view, when the pin is tapped, i launch a method of the CustomAnnotationView, adding (or removing) the thumbnail.
I think the method number 2 could work, but i've got no idea how to deal with the touch on the thumbnail.
Any suggestions or help on this ?
Thanks you !
Updated 2016-09-02:
My colleague devised an workaround by making popup views as subview of the view container which contains the map view. The position can be calculated according to the CGPoint transform in different reference systems.
Original Answer:
I also got this kind of problem, after following the tutorial 'Building Custom Map Annotation Callouts – Part 1', the interaction becomes difficult.
Have you tried the tap gesture recognizer? I added it to a subview, it works, although the code smell bad.