目的
Google Map Kit利用時の初回表示場所(中心点)を切り替える方法のメモ
環境
- Xcode Version 11.6
- Swift5
実装メモ
...
@IBOutlet weak var googlemap: GMSMapView!
...
//中心点の緯度 値は適当
let latitude: CLLocationDegrees = 35.772739
//中心点の経度 値は適当
let longitude: CLLocationDegrees = 138.1413573
//拡大比率 大きいほどズーム
let zoom: Float = 9
let camera: GMSCameraPosition = GMSCameraPosition.camera(withLatitude: latitude,longitude: longitude, zoom: zoom)
googlemap.camera = camera
...
zoomが9の場合
zoomが2の場合