Javascript: взять каждый n-й элемент массива

Выяснил это.

Когда mapView изменяет область, получите Lat и Lon из CLLocationCoordinate2D и создайте переменную CLLocation с переданными лат и lon.

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)

}
15
задан thefourtheye 2 November 2015 в 16:54
поделиться