2014-11-11 8 views

답변

32

알아 냈어.

지도보기 영역이 변경 될 때, CLLocationCoordinate2D의 위도와 경도를 얻을 전달 된 위도 및 경도와 CLLocation 변수를 생성한다.

func mapView(mapView: MKMapView!, regionDidChangeAnimated animated: Bool){ 

    var centre = mapView.centerCoordinate as CLLocationCoordinate2D 

    var getLat: CLLocationDegrees = centre.latitude 
    var getLon: CLLocationDegrees = centre.longitude 


    var getMovedMapCenter: CLLocation = CLLocation(latitude: getLat, longitude: getLon) 

    self.lastLocation = getMovedMapCenter 
    self.fetchCafesAroundLocation(getMovedMapCenter) 

}