我已尝试在产品中设置默认位置 - >方案 - >允许当前位置设置。
func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
let location: CLLocation = locations.first!
self.mapView.centerCoordinate = location.coordinate
let reg = MKCoordinateRegionMakeWithDistance(location.coordinate, 1500, 1500)
self.mapView.setRegion(reg, animated: true)
geoCode(location)
}
func locationManager(manager: CLLocationManager, didFailWithError error: NSError) {
print(error)
}