I have an ios application built to use mapkit and corelocation. the application works with no error but the map doesnt pin point my current location in xcode simulator and when run on an actual device it does not show the land scape and other things. just a blank map with a single road and it cannot be zoomed in or out. below is my code
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
//IF we have coordinate from manager
//let location = locations.last as CLLocation
if let location = locationManager.location?.coordinate{
userLocation = CLLocationCoordinate2D(latitude: location.latitude, longitude: location.longitude)
let region = MKCoordinateRegion(center: userLocation!, span: MKCoordinateSpan(latitudeDelta: 0.01, longitudeDelta: 0.01))
mapView.setRegion(region, animated: true)
mapView.removeAnnotations(mapView.annotations)
let annotation = MKPointAnnotation()
annotation.coordinate = userLocation!
annotation.title = "Me!"
mapView.addAnnotation(annotation)
}
}
additional codes would be supplied on request