tags:

views:

796

answers:

2

I'm writing an iPhone application that will contain a custom map -- my own image for the map, not Google's. The image isn't very large, so instead of using a library such as RouteMe, I'm opting for just a UIScrollView with an embedded image (the map).

My question is: it is possible to re-use Apple's MKPinAnnotationView classes on top of my custom UIView so that the pin interactions will feel the same as MapKit? I have so far figured out how to add a pin to my map and position it, but I can't figure out how to let the user interact with it -- i.e. make the description bubble pop up.

Any thoughts? Thanks very much.

A: 

You might be able to make one and use add subview in order to display it, ull prolly have to do some work to get it to display where u want it to since the coordinates u give are meant to work eith mkmaps

Daniel
A: 

Have you looked at this method from MKAnnotationView:

  • (void)setSelected:(BOOL)selected animated:(BOOL)animated

It's the only method that is publicly exposed that may show/hide the callout bubble. Other than that, you'd have to reverse engineer the classes and start poking around.

However, I would highly recommend against reverse engineering the classes and using methods that aren't publicly exposed. Apple makes no promises on maintaining backwards compatibility and if they figure out that you are using private methods, they'll kick your app from the store.

btw, full disclosure, these are Apple's documentation notes for setSelected:animated:

Discussion You should not call this method directly. An MKMapView object calls this method in response to user interactions with the annotation.

Kelvin
Can we in code cause the call out to show?
BahaiResearch.com