[問題] 旋轉 google map 的疑問
大家好~
我的問題是:
我想利用sensor的三軸感測
來旋轉畫面中的google map跟實際的方向結合
而google map 起初的方位是朝北的(紅色指針往上)
並可以透過手勢觸控旋轉改變其方位
請問各位前輩,
有方法可以透過程式碼旋轉其方位嗎?
(我的google map是放在view內)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.205.97.187
※ 編輯: AZHI 來自: 123.205.97.187 (03/16 20:42)
→
03/17 01:05, , 1F
03/17 01:05, 1F
→
03/19 08:21, , 2F
03/19 08:21, 2F
※ 編輯: AZHI 來自: 123.205.97.187 (03/19 08:22)
已解決
方法為 加入
public void updateCamera(float bearing) {
CameraPosition currentPlace = new CameraPosition.Builder()
.target(new LatLng(centerLatitude, centerLongitude))
.bearing(bearing).tilt(65.5f).zoom(18f).build();
googleMap.moveCamera(CameraUpdateFactory.newCameraPosition(currentPlace));
}
就可以轉了~
※ 編輯: AZHI 來自: 123.205.97.187 (03/19 20:22)