tags:

views:

40

answers:

1

MyAnnotation *ann1 = [[MyAnnotation alloc] init];

ann1.coordinate =region.center;

[mapView addAnnotation:ann1]; right now its purple i want red

+1  A: 

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;

}
Charter
thnkas and what about if i want to add 1 more red annotaion just say a distance of 5 m ahead form current point
ram
Add another annotation at this point?
Charter
i want to show user current location and destination... right now i can show only destination plz help me to show current location in that map this is my dest code
ram
[code] NSString * theAddress = [myString stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%@ //NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%g",daddr,saddr]; //NSLog(@" GEO44 is %@",urlString); NSString *locationString = [[[NSString alloc] initWithContentsOfURL:[NSURL URLWithString:urlString]] autorelease]; NSLog(@" GEO MAP is %@",locationString);[/code]
ram
NSString * theAddress = [myString stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%@ //NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%g",daddr,saddr]; //NSLog(@" GEO44 is %@",urlString); NSString *locationString = [[[NSString alloc] initWithContentsOfURL:[NSURL URLWithString:urlString]] autorelease]; NSLog(@" GEO MAP is %@",locationString);
ram
You can show user location setting the showsUserLocation property to YES.
Charter
is it possible to show a defult message on 1 annotation??
ram
Could you be more precise ? How do you want the message to be displayed ?
Charter