wenn wir eine mapview laden, es automaticallay zeigt den aktuellen Standort des Nutzers richtig. In meinem Fall zeige ich einen anderen Ort auf der Karte, so dass die Karte den aktuellen Standort lädt und gezoomt auf den Standort i gegeben haben .. aber wurde die aktuelle Position Punkt nicht angezeigt (die blaue, die automaticay kommt ..). Ich habe mapView.showCurrentLocation = TRUE gegeben; aber es ist nicht zeigt. so könnte jemand sagt, wie es funktioniert, und es sollte die aktuelle Position Marke sagen und dann auf den Punkt gezoomt i gegeben haben. Vielen Dank
- (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;
}













