我正在使用这个布局与新的Android Maps V2:
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment"
map:cameraBearing="270"/>
我正在尝试使用newLatLngBounds(LatLngBounds bounds, int padding)方法来缩放和查看地图中的所有标记,但相机方向被设为了0。
谷歌开发者文档上的描述如下:
public static CameraUpdate newLatLngBounds (LatLngBounds bounds, int padding) (...)。返回的CameraUpdate具有0度方向和0度倾斜度。(...)
我该如何更改方向值?
我尝试在调用newLatLngBounds后编程设置新的方向,类似于以下内容:
mMap.moveCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100));
mMap.moveCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition.Builder()
.target(mMap.getCameraPosition().target)
.zoom(mMap.getCameraPosition().zoom)
.bearing(270)
.build()));
但是当我这样做时,有些标记不会显示。