How to customize the callout bubble for MKAnnotationView?

There is an even easier solution. Create a custom UIView (for your callout). Then create a subclass of MKAnnotationView and override setSelected as follows: – (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; if(selected) { //Add your custom view to self… } else { //Remove your custom view… } } Boom, job done.

determine if MKMapView was dragged/moved

The code in the accepted answer fires when the region is changed for any reason. To properly detect a map drag you have to add a UIPanGestureRecognizer. Btw, this is the drag gesture recognizer (panning = dragging). Step 1: Add the gesture recognizer in viewDidLoad: -(void) viewDidLoad { [super viewDidLoad]; UIPanGestureRecognizer* panRec = [[UIPanGestureRecognizer alloc] … Read more

How to intercept touches events on a MKMapView or UIWebView objects?

The best way I have found to achieve this is with a Gesture Recognizer. Other ways turn out to involve a lot of hackish programming that imperfectly duplicates Apple’s code, especially in the case of multitouch. Here’s what I do: Implement a gesture recognizer that cannot be prevented and that cannot prevent other gesture recognizers. … Read more

How to delete all Annotations on a MKMapView

Yes, here is how [mapView removeAnnotations:mapView.annotations] However the previous line of code will remove all map annotations “PINS” from the map, including the user location pin “Blue Pin”. To remove all map annotations and keep the user location pin on the map, there are two possible ways to do that Example 1, retain the user … Read more

Zooming MKMapView to fit annotation pins?

This is the one I found here that worked for me: (EDIT: I have updated the solution using @Micah’s suggestion to increase the pointRect by 0.1 to ensure the rect doesn’t end up being infinitesimally small!) MKMapRect zoomRect = MKMapRectNull; for (id <MKAnnotation> annotation in mapView.annotations) { MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate); MKMapRect pointRect = MKMapRectMake(annotationPoint.x, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)