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

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

    var search:AMapSearchAPI!
    var minePin:MinePinAnnotation!
    var minePinView:MAPinAnnotationView!
    var searchNear = true
    var currentAnnotations : [MAPointAnnotation] = []
    
    override func viewDidLoad() {
        super.viewDidLoad()
