LoginSignup
1
0

More than 1 year has passed since last update.

MKMapView 今日使用したプロパティ(復習)

Posted at

今回の内容

今日使用したMKMapViewのプロパティを復習

コードと簡単解説

  • Main.storyboardでMKMapViewを作成しておきます。
    @IBOutlet weak var mapView: MKMapView!

Mapの見た目(.mapType)

.mapType
        mapView.mapType = .standard
        mapView.mapType = .satellite  //航空表示
        mapView.mapType = .satelliteFlyover //立体的な航空表示
        mapView.mapType = .hybrid //航空表示に.standardのmapが表示
        mapView.mapType = .hybridFlyover //立体的な航空表示に.standardのmapが表示

スクロールをさせるか?(.isScrollEnabled)

.isScrollEnabled
        mapView.isScrollEnabled = true  //スクロールができる
        mapView.isScrollEnabled = false  //スクロールができない

ズームのできるようにするか?(.isZoomEnabled)

.isZoomEnabled
        mapView.isZoomEnabled = true  //ズームができる
        mapView.isZoomEnabled = false  //ズームできない

マップを回せるようにするか?(.isRotateEnabled)

.isRotateEnabled
        mapView.isRotateEnabled = true  //回せる
        mapView.isRotateEnabled = false  //回せない

終わり

ご指摘、ご質問などありましたら、コメントまでお願い致します。

1
0
5

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0