views:

745

answers:

1

i am using map kit and showing customized annonation view.one is carImage and the another one is userImage(as current location of user).now i want to show current user location default which is provided by map kit.but unable to show it.how do i show blue circle+my car in map kit?

A: 

To show the user location, set the following property to true on the map view object

mapView.showsUserLocation = YES;

To display a custom annotation, set image property on the map view annotation

- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation 
{
        // check for nil annotation, dequeue / reuse annotation
        // to avoid over riding the user location default image ( blue dot )
        if ( mapView.UserLocation == annotation ) {
        return nil; // display default image
        }
        annotation.Image = carImage;
}
Hussain Saleem