国产精品久久久aaaa,日日干夜夜操天天插,亚洲乱熟女香蕉一区二区三区少妇,99精品国产高清一区二区三区,国产成人精品一区二区色戒,久久久国产精品成人免费,亚洲精品毛片久久久久,99久久婷婷国产综合精品电影,国产一区二区三区任你鲁

您好,歡迎來電子發燒友網! ,新用戶?[免費注冊]

您的位置:電子發燒友網>源碼下載>通訊/手機編程>

MapKit地圖當前位置及大頭針

大小:0.3 MB 人氣: 2017-09-26 需要積分:1

  創建大頭針、增加標記及覆蓋物

  步驟-SB拖入地圖視圖-然后如下

  MapKit地圖當前位置及大頭針

  import MapKit

  class MapViewController: UIViewController,MKMapViewDelegate {

  @IBOutlet weak var mapView: MKMapView!

  override func viewDidLoad() {

  super.viewDidLoad()

  self.mapView.delegate = self

  //創建大頭針

  let center = CLLocationCoordinate2DMake(23.114155, 113.318977)

  let span = MKCoordinateSpanMake(0.2, 0.2)

  self.mapView.region = MKCoordinateRegionMake(center, span)

  //向地址增加標記

  let annotation = MKPointAnnotation()

  annotation.coordinate = center

  annotation.title = “當前大約位置”

  annotation.subtitle = “”

  self.mapView.addAnnotation(annotation)

  //創建一個新的圓形覆蓋物

  let overlay = MKCircle(centerCoordinate: center, radius: 5000)

  self.mapView.addOverlay(overlay)

  }

  //自定義大頭針樣式,默認是紅色

  //func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -》 MKAnnotationView?

非常好我支持^.^

(0) 0%

不好我反對

(0) 0%

      發表評論

      用戶評論
      評價:好評中評差評

      發表評論,獲取積分! 請遵守相關規定!

      ?