func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
let userLocation: CLLocation = locations[0]
let center = CLLocationCoordinate2D(latitude: userLocation.coordinate.latitude, longitude: userLocation.coordinate.longitude)
mylat = userLocation.coordinate.latitude
mylong = userLocation.coordinate.longitude
let region = MKCoordinateRegion(center: center, span: MKCoordinateSpan(latitudeDelta: 0.04, longitudeDelta: 0.04))
totalMap.setRegion(region, animated: true)
}
first.. i'm sorry for my english writning...
i used to mylat
, mylong
in that func ..
but i want to add user recently location with global variable
and i use that user location in viewDidLoad
..
actually i need user location(lat,long)
and many other location,
and then i use comparing opration with two location,
and i need to most of nearly location ..
help me