//创建地图
let mapview = MAMapView(frame: self.view.bounds)
mapview.delegate = self
self.view.addSubview(mapview)
self.navigationController?.navigationItem.title = "附近旅伴"
//显示用户位置
mapview.isShowsUserLocation = true
mapview.userTrackingMode = .follow
//配置显示当前位置的小蓝点
mapview.userLocation.title = "Bohemian"
mapview.userLocation.subtitle = "Rey"
//后台更新坐标
mapview.pausesLocationUpdatesAutomatically = false
mapview.allowsBackgroundLocationUpdates = true
AMapServices.shared().enableHTTPS = true
//大头针测试
var mapa = MAPointAnnotation()
mapa.coordinate = CLLocationCoordinate2DMake(36.66694, 117.14017)
mapa.title = "山东大学软件学院"
mapa.subtitle = "Here we are"
mapview.addAnnotation(mapa)
我基本上使用到的就是地图、标注、标注的view等信息内容。