views:

395

answers:

2

I am working on a iPhone Application

My requirement is,

When i open my app it must open a globe we can rotate the globe by touching it.We have to pin point the important cities like maps.When we click on the pin we have to zoom in and show the city nearer.

Is it possible to do it by using MKMapView.Can you please Help me.

+2  A: 

MKMapView doesn't display a map in 3D, which is what it sounds like you want with the spinning globe.

As far as identifying points and zooming on on locations, both are very doable with MKMapView, albeit in 2D.

Hunter
Q: How does one detect a tap on a specific MKMapView _pin_? I have yet to find the method for this. I presume this is needed in order to respond by zooming in, but only if the pin is tapped.
Joe D'Andrea
Depends on if you have a custom annotation view or not. Check out- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation and - (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control on the delegate.
Hunter
A: 

The best work around that I have found is to create a custom AnnotationView. Within the AnnotationView create a -(void)BeginTouch method. Add you custom methods here... For example, I've called NotificationCenter below.

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 

UITouch* aTouch = [touches anyObject]; 
startLocation = [aTouch locationInView:[self superview]]; 
originalCenter = self.center; 
[[NSNotificationCenter defaultCenter] postNotificationName:@"mapNoteSelected" object:self userInfo:nil];
[super touchesBegan:touches withEvent:event]; }

Hope that helps!

Cody Evers