I Want to draw a Pin programatically like MKPinAnnotationView Pin instead of using a Pin image. If anyone have idea please help me.
Thanks
I Want to draw a Pin programatically like MKPinAnnotationView Pin instead of using a Pin image. If anyone have idea please help me.
Thanks
try this in
-(MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation: (id )annotation
if(annotation != mapView.userLocation)
{
static NSString *defaultPinID = @"PinId1";
pinView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:defaultPinID];
if ( pinView == nil ) pinView = [[[MKPinAnnotationView alloc]
initWithAnnotation:annotation reuseIdentifier:@"pin1"] autorelease];
//pinView= [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"pin1"];
//pinView.pinColor = MKPinAnnotationColorRed;
pinView.canShowCallout = YES;
pinView.animatesDrop = YES;
[pinView setImage:[UIImage imageNamed:@"user.png"]];
}