To show the user's location, set the map property to the following property:
mapView.showsUserLocation = YES;
,
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation
{
if ( mapView.UserLocation == annotation ) {
return nil;
}
MKAnnotationView* pin = (MKAnnotationView*)
[mapView dequeueReusableAnnotationViewWithIdentifier: PIN_RECYCLE_ID];
if ( pin == nil ) {
pin = [(MKAnnotationView*) [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier: PIN_RECYCLE_ID] autorelease] ;
pin.canShowCallout = YES;
}
else {
[pin setAnnotation: annotation];
}
pin.image = [UIImage imageNamed:@"car-image.png"];
return pin;
}