     fileprivate func searchNearBike() {
         searchCustomLocation(mapView.userLocation.coordinate)
     }
+    
+    
+    //大头针动画
+    fileprivate func pinAnimation() {
+        
+        let frame = minePinView.frame
+        UIView.animate(withDuration: 0.6, animations: {
+            self.minePinView.frame = frame.offsetBy(dx: 0, dy: -20)
+
+        }) { (completed) in
+            UIView.animate(withDuration: 0.6, animations: {
+                self.minePinView.frame = frame
+            })
+        }
+    }
 
 }
 

            return annotation
        }
        
        mapView.addAnnotations(annotations)
        mapView.showAnnotations(annotations, animated: true)
        
    }
    
    //自定义大头针

        mapView.showAnnotations([minePin], animated: true)
    }
    
    //用户移动地图，重新搜索
    func mapView(_ mapView: MAMapView!, mapDidMoveByUser wasUserAction: Bool) {
        
        if wasUserAction{
            minePin.isLockedToScreen = true
            pinAnimation()
            searchCustomLocation(mapView.centerCoordinate)
        }
    }
    
}

