2009-07-29 58 views
0

我在iPhone應用程序關於的MKMapView

我的要求是工作,

當我打開我的應用程序必須打開一個地球,我們可以通過觸摸it.We有針點的重要旋轉地球城市如地圖。當我們點擊地圖時,我們必須放大並向城市靠近。

是否可以通過使用MKMapView.Can請幫助我。

回答

0

我發現最好的解決方法是創建一個自定義AnnotationView。在AnnotationView中創建一個 - (void)BeginTouch方法。在這裏添加自定義方法...例如,我在下面調用了NotificationCenter。

- (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]; } 

希望幫助!

2

MKMapView不會在3D中顯示地圖,這就是您想要的旋轉地球儀。

就識別點和縮放位置而言,兩者都非常適合MKMapView,儘管採用2D。

+0

問:如何檢測特定MKMapView _pin_上的一個水龍頭?我還沒有找到這方面的方法。我認爲這是需要的,以便通過放大來響應,但只有在該引腳被點擊時纔是如此。 – 2009-09-25 13:51:01