I ask for your help in resolving this problem:
I have an XML I am presenting the file in another method on my map view, showing my current status on the map:
- (zero) setpoi {nslog (@ "DIET POIs"); Int x = 0; While (x & lt; [rs count]) {CLLocationCoordinate2D c; NSString * latitude = [[res objectAtIndex: x] objectForKey: @ "latitude"]; NSSTING * Longitude = [[res objectAtIndex: x] objectForKey: @ "longitude"]; C.latitude = [latitude double value]; Clongitude = [latitude double value]; GPS Notation * Annotation = [[GPS Annotation Eloc] Coordination with Init: C]; Annotation MT = [[Res object object xx] objectfore: @ "ordinum"]; Annotation.currentPoint = [With NSNumber numbers: [[[res objectAtIndex: x] ObjectForekey: @ "Tierrajetid"] [Interview]]; Annotation.currentRow = [res object-endxx: x]; [MapViewOutlet addNnotation: annotation]; [Annotation release]; NSLog (@ "Latitude Set Poi:% @", Latitude); X ++; } [Shove himself]; }
- (zero) ShowOpen {
CLLocationCoordinate2D c; C.latitude = location.latitude; C.longitude = location.longitude; GPS annotation * annotation 1 = [[GPS annotation alloc] init with corodeanate: C]; Annotation 1 MT == "Ihhar Standout"; [MapViewOutlet addNnotation: Annotation 1]; [Annotation 1st release];
GPS Notation *) Annotation {int postag = 0; // int line = 0; MKPinAnnotationView * annView = [[MKPinAnnotationView alloc] initWithNnotation: Annotation re-users: @ "currentloc"]; AnnView.pinColor = MKPinAnnotationColorGreen; UIButton * myDetailButton = [UIButtonTypeCustom] with UIButton Button; MyDetailButton.frame = CGRectMake (0, 0, 23, 23); MyDetailButton.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; MyDetailButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter; // Set image for button [myDetailButton setImage: [UIImage imageNamed: @ "button_right.png"] forState: UIControlStateNormal]; [MyDetailButton addTarget: Self-action: @Selector (Show links) Control events: UIControlEventTouchUpInside]; If ([[annotation title] extolstration: @ "current location"]) {postag = 99999; } And {postag = [annotation.currentPoint intValue]; } MyDetailButton.tag = postag; // Set the button as view callout annView.rightCalloutAccessoryView = myDetailButton; AnnView.animatesDrop = No; AnnView.canShowCallout = Yes; AnnView.calloutOffset = CGExMake (-5, 5); Return annually; [AnnView release];
}
What can I do to display a custom image for my current state - and / or to not display any disclosure buttons?
Thank you for your response! I solved only if ... and optimized the statement
- (MKAnnotationView *) mapView: (MKMapView *) mapViewOutlet viewForNnotation: (GPSNnotation *) Annotation {int postag = 0; // int line = 0; MKPinAnnotationView * annView = [[MKPinAnnotationView alloc] initWithNnotation: Annotation re-users: @ "currentloc"]; AnnView.pinColor = MKPinAnnotationColorGreen; UIButton * myDetailButton = [UIButtonTypeCustom] with UIButton Button; MyDetailButton.frame = CGRectMake (0, 0, 23, 23); MyDetailButton.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; MyDetailButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter; If ([[annotation title is] avatostring: @ "Ayehar standout"]) {postag = 99999; UIImage * annotationImage = [UIImage imageNamed: @ "07-map-marker.png"]; AnnView.image = Annotation Image; } And {postag = [annotation.currentPoint intValue]; [MyDetailButton setImage: [UIImage imageNamed: @ "button_right.png"] forState: UIControlStateNormal]; [MyDetailButton addTarget: Self-action: @Selector (Show links) Control events: UIControlEventTouchUpInside]; } MyDetailButton.tag = postag; // Set the button as view callout annView.rightCalloutAccessoryView = myDetailButton; AnnView.animatesDrop = No; AnnView.canShowCallout = Yes; AnnView.calloutOffset = CGExMake (-5, 5); Return annually; [AnnView release]; }
br
Stephen
Comments
Post a Comment