Swift Map 標準地図


 MapKit framework を追加


import UIKit

import MapKit

class ViewController: UIViewController, MKMapViewDelegate {

    @IBOutlet weak var mkMap: MKMapView!


    override func viewDidLoad() {


        // Do any additional setup after loading the view, typically from a nib.


        // Delegate をセット

        self.mkMap?.delegate = self


        // 緯度・軽度を設定 大阪難波

        var location:CLLocationCoordinate2D

        = CLLocationCoordinate2DMake(34.666316,135.500277)




        // 縮尺を設定

        var region:MKCoordinateRegion = self.mkMap!.region

        region.center = location

        region.span.latitudeDelta = 0.02

        region.span.longitudeDelta = 0.02




        // 表示タイプを標準写真に設定


        * MKMapType.Standard    標準写真

        * MKMapType.Satellite   航空写真

        * MKMapType.Hybrid      ハイブリット


        self.mkMap!.mapType = MKMapType.Standard



    override func didReceiveMemoryWarning() {


        // Dispose of any resources that can be recreated.



GitHub MapViewSwift01



目 次



コメント: 2
  • #1

    Mui Yarber (月曜日, 23 1月 2017 06:11)

    What's Happening i'm new to this, I stumbled upon this I've discovered It absolutely helpful and it has helped me out loads. I'm hoping to give a contribution & assist other customers like its aided me. Great job.

  • #2

    Delinda Boren (月曜日, 23 1月 2017 06:45)

    Having read this I believed it was rather enlightening. I appreciate you spending some time and effort to put this content together. I once again find myself spending way too much time both reading and commenting. But so what, it was still worthwhile!