0
在我的地圖視圖中,我將地圖設置爲打開,然後延遲2秒,地圖放大以顯示我的mkannotation,我一直在試圖做的動作是將pin一旦視圖完全放大,但一直未能實現這一點。如何添加延遲到mkannotation pin drop
所以基本上我想添加一個延遲到註釋+引腳被丟棄在我的位置。
我該怎麼做?
代碼我有什麼替代目前在viewDidLoad中,對於mkannotation的代碼是無效 - showDetails:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
[mapView setMapType:MKMapTypeStandard];
[mapView setZoomEnabled:YES];
[mapView setScrollEnabled:YES];
MKCoordinateRegion region = { {0.0, 0.0 }, { 0.0, 0.0 } };
region.center.latitude = 54.5;
region.center.longitude = -3.5;
region.span.longitudeDelta = 10.0f;
region.span.latitudeDelta = 10.0f;
[mapView setRegion:region animated:NO];
[self performSelector:@selector(zoomInToMyLocation)
withObject:nil
afterDelay:2]; //will zoom in after 2 seconds
}
-(void)zoomInToMyLocation
{
MKCoordinateRegion region = { {0.0, 0.0 }, { 0.0, 0.0 } };
region.center.latitude = 51.502729 ;
region.center.longitude = -0.071948;
region.span.longitudeDelta = 0.19f;
region.span.latitudeDelta = 0.19f;
[mapView setRegion:region animated:YES];
[mapView setDelegate:self];
DisplayMap *ann = [[DisplayMap alloc] init];
ann.title = @"Design Museum";
ann.subtitle = @"Camberwell, London";
ann.coordinate = region.center;
[mapView addAnnotation:ann];
}
不太明白你... – holtii
你有什麼問題嗎? – Craig
我的mapview延遲工作,然後它放大隻是我想要的,問題是我想延遲引腳刪除,我試圖把它在自己的方法,但它沒有奏效。 – holtii