2014-11-11 20 views

Odpowiedz

32

Wyliczyłem to.

Kiedy MapView zmienia region uzyskać Lat i Lon od CLLocationCoordinate2D i utworzyć zmienną CLLocation z łac i lon przeszedł w.

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) 

}