我用了 CoreLocation 获取经纬度,在收到经纬度数据后使用下面的代码配置地图:
var Map = MKMapView()
let Center = CLLocationCoordinate2D(纬度数据, 精度数据)
let Span = MKCoordinateSpanMake(0.02, 0.02)
let annotation = MKPointAnnotation()
annotation.coordinate = Center
annotation.title = "当前位置"
Map.showsUserLocation = true
Map.region = MKCoordinateRegionMake(Center, Span)
Map.addAnnotation(annotation)
但实际上大头针的位置与真实位置差了一点
为啥会差这么一点呢? mapview 不也是用 CoreLocation 的数据吗?但是如我我吧经纬度数据复制出来,放到 OS X 的地图应用里面搜索,却能得到我当前的位置。