簡體   English   中英

使用Mapkit時,我可以看到完全可滾動的地圖,但是沒有Apple總部?

[英]In using the Mapkit, I can see the fully scrollable map however no Apple headquarters?

我已經在實際設備(iPad)和iPhone模擬器(ios 4)上都嘗試過

即使放大地圖,我也看不到地圖,但沒有看到蘋果總部(藍色圖釘)。

在我的OnViewLoad函數中,我有:

mapView = [[MKMapView alloc] initWithFrame:self.view.bounds];

mapView.showsUserLocation=TRUE;
mapView.mapType=MKMapTypeHybrid;

[self.view insertSubview:mapView atIndex:0];

-mapView:viewForAnnotation:方法中,如果注釋是userLocation對象,則返回nil:

- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation {
    if ([annotation isMemberOfClass:[MKUserLocation class]]) {
        return nil;
    }
    // your normal code
}

需要確保使用iOS默認實現來顯示藍色的userLocation點。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM