Reputation: 426
I just want to show the current location in mkMapView and the map is centered at current location and coordinates and address info should also be displayed.How it can be achieved.By using showCurrentlocation to YES shows the blue pointer and shows the informaiton "current location".But,I want the detailed info on clicking that blue button.please help me.
Upvotes: 0
Views: 319
Reputation: 7643
In the viewForAnnotation method of your MKMapViewDelegate(you have also to generate the addresses with the reverse geocoding)you could try this:
- (MKAnnotationView *)map:(MKMapView *)map viewForAnnotation:(id <MKAnnotation>) annotation{
if(self._mapView.userLocation==annotation){
self._mapView.userLocation.title=@"yourCityObtainedByReverseGeocoding";
self._mapView.userLocation.subtitle=@"yourStreetObtainedByReverseGeocoding";
return nil;
}
}
Hope this helps.
Upvotes: 1