Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom callout for current location

I want to display a 2 line label in the callout for current location. MKUserLocation and not MKAnnotation Can anybody help with how is it possible?

Am sure It would be possible with custom Callout.. But not sure how to create it for MKUserLocation.

like image 396
Suresh Varma Avatar asked Nov 18 '11 08:11

Suresh Varma


1 Answers

In the viewForAnnotation method you could try this:

- (MKAnnotationView *)map:(MKMapView *)map viewForAnnotation:(id <MKAnnotation>) annotation{
    if(self._mapView.userLocation==annotation){
       self._mapView.userLocation.title=@"some text";
       self._mapView.userLocation.subtitle=@"some text";
       return nil;
    }
}

Hope this helps.

like image 190
Mat Avatar answered Oct 10 '22 05:10

Mat