女人自慰AV免费观看内涵网,日韩国产剧情在线观看网址,神马电影网特片网,最新一级电影欧美,在线观看亚洲欧美日韩,黄色视频在线播放免费观看,ABO涨奶期羡澄,第一导航fulione,美女主播操b

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

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

MapKit地圖當前位置及大頭針

大?。?/span>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%

      發表評論

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

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

      ?