ios - How to open call out MKAnnotationView programmatically? (iPhone, MapKit) -
I want to open the callout for a MKPinNnotationView
program, for example I can add 10 pins on the map I'm dropping, and I want to open the closest one. How can I go about doing this?
Apple has specified the 'selected' parameter for MKAnnotationView's
, but frustrated it by setting it straight (it does not work, it has tried to do it) .
For the rest, only one set in MKAnnotationView
is highlighted ( same story ), and ShowCallout
method.
Any indication if this is all possible?
Make a visual method in your map viewer:
- ( Zero) Open annotation: (ID) annotation {// mv is map view [MV select: animated annotation: yes]; }
You can then determine the closest annotation based on the current location and can run the available annotations in the array.
[mv annotations];
After calculating the closest annotation, call:
[Auto open annotation: closest annotation];
Map view should be automatically scrolled to move its annotation to the center of the display area.
Comments
Post a Comment