项目介绍:
集成 mapkit ,主要代码如下:
[Objective-C] 查看源文件 复制代码
// 添加地图视图
mapView = MKMapView.init(frame: self.view.frame)
mapView.mapType = MKMapType.Standard
//mapView.scaleOrigin = CGPointMake(100, mapView.frame.size.height-20)
self.view.addSubview(mapView)
// 按钮
btn.frame = CGRectMake(10, 30, 100, 50)
btn.setTitle("定位", forState: .Normal)
btn.addTarget(self, action: "setLocation:", forControlEvents: .TouchUpInside)
self.view.addSubview(btn)
self.locateMannage.delegate = self
// 发送授权
if self.locateMannage.respondsToSelector(Selector("requestAlwaysAuthorization")) {
self.locateMannage.requestAlwaysAuthorization()
}
// 精度
self.locateMannage.desiredAccuracy = kCLLocationAccuracyBest
// 更新距离
locateMannage.distanceFilter = 100
// 开启更新位置服务
//self.locateMannage.startUpdatingHeading()
DEMO 直接下载:

Location.zip
(26.56 KB, 下载次数: 73, 售价: 3 金钱)
2016-7-18 17:47 上传
点击文件名下载附件
