2014-11-11 15 views

cevap

32

Şekil verilmiş.

MapView bölgesini değiştirdiğinde, CLLocationCoordinate2D lat ve Lon alma ve geçirilen enlem ve boylam bir CLLocation değişken oluşturmak.

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) 

}