         map.addAnnotations(Array(add))
         map.removeAnnotations(Array(remove))
     }
+}
+
+func addBounceAnimation(toView view: UIView) {
+    let bounce = CAKeyframeAnimation(keyPath: "transform.scale")
+    bounce.values = [0.05, 1.1, 0.9, 1.0]
+    bounce.duration = 0.6
+    
+    var timingFunctions: [CAMediaTimingFunction] = []
+    
+    for _ in 0..<4 {
+        timingFunctions.append(CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut))
+    }
+    bounce.timingFunctions = timingFunctions
+    bounce.isRemovedOnCompletion = false
+    
+    view.layer.add(bounce, forKey: "bounce")
 }
 
 class TestDelegate: NSObject, MKMapViewDelegate {

    return annotations
}

func update(mapView map: MKMapView, annotations: [QTRNodePoint]) {
    var before = Set<QTRNodePoint>(map.annotations as! [QTRNodePoint])
    let after = Set<QTRNodePoint>(annotations)

            update(mapView: mapView, annotations: annos as! [QTRNodePoint])
        }
    }
    
    func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
        let r = QTRNodePointView()
        let x = annotation as! QTRNodePoint
        r.count = Int(x.name)!
        
        return r
    }
    
    func mapView(_ mapView: MKMapView, didAdd views: [MKAnnotationView]) {
        for view in views {
            addBounceAnimation(toView: view)
        }
    }
}

let frame: CGRect = CGRect(x: 0, y: 0, width: 360, height: 360)
