når vi laster en mapview, viser det automaticallay den aktuelle brukeren beliggenhet rett. I mitt tilfelle jeg viser en annen posisjon på kartet, slik at kartet laster gjeldende plassering og zoomet til det stedet jeg har gitt .. men, den nåværende plassering poenget var ikke viser (den blå som kommer automaticay ..). Jeg har gitt mapView.showCurrentLocation = TRUE; men det er ikke vist. så kan noen forteller hvordan det fungerer, og det bør si det gjeldende stedet mark og deretter zoomet til det punktet jeg har gitt. Takk
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation {
static NSString *defaultPinID = @CameraAnnotation;
MKPinAnnotationView *retval = nil;
static int postag=1;
(MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:defaultPinID];
if(annotation=MapView.userLocation)
{
return nil;
}
// If we have to, create a new view
else if (retval == nil)
{
retval = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:defaultPinID] autorelease];
UIButton *myDetailButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
myDetailButton.frame = CGRectMake(0, 0, 50, 23);
myDetailButton.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
myDetailButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
myDetailButton.tag=postag;
postag++;
[myDetailButton addTarget:self action:@selector(showLinks:) forControlEvents:UIControlEventTouchUpInside];
retval.rightCalloutAccessoryView = myDetailButton;
[retval setPinColor:MKPinAnnotationColorRed];
retval.animatesDrop = YES;
retval.canShowCallout = YES;
}
return retval;
}













