1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Android】cameraPosition【kotlin】

1
Posted at

はじめに

今回は cameraPositionを使う機会があったので、それについて記事にします

cameraPosition

cameraPositionとは GoogleMap使用時に使われるもので
公式では

位置、ズーム レベル、傾斜角、方位など、すべてのカメラ位置パラメーターを集約する不変クラス

とあります。
それぞれ使い方などを記載していきます。

private lateinit var googleMap: GoogleMap

まずはgoogleMapをアプリ内で使用できるようにインスタンス化します。
あとは以下の要素を使うだけです。

要素 意味
bearing カメラが向いている方向(方角)
target カメラが指している場所
tilt 地面からのカメラ角度
zoom 画面中央付近のズームレベル
println(googleMap.cameraPosition.target)

とするとカメラの向いている方角を知ることができます。

参考

1
0
0

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?