MyAnnotation *ann1 = [[MyAnnotation alloc] init];
ann1.coordinate =region.center;
[mapView addAnnotation:ann1];
right now its purple i want red
MyAnnotation *ann1 = [[MyAnnotation alloc] init];
ann1.coordinate =region.center;
[mapView addAnnotation:ann1];
right now its purple i want red
Implement MKMapViewDelegate protocol callback and set the implementing class as the map view delegate
- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation {
MKPinAnnotationView *newAnnotationPin = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"simpleAnnotation"] autorelease];
newAnnotationPin.pinColor = MKPinAnnotationColorRed; // Or Red/Green
return newAnnotation;
}
© 2022 - 2024 — McMap. All rights reserved.