I'm using the new Android maps V2 with this layout:
<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"/>
I'm trying to use the method newLatLngBounds (LatLngBounds bounds, int padding) for zooming and seeing all my markers in the map, however the camera bearing is set to 0.
The description on google developers documentation says:
public static CameraUpdate newLatLngBounds (LatLngBounds bounds, int padding) (...) . The returned CameraUpdate has a bearing of 0 and a tilt of 0. (...)".
How can I change the bearing value?
I tried to set a new bearing programmatically after the call of newLatLngBounds, something like this:
mMap.moveCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100));
mMap.moveCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition.Builder()
.target(mMap.getCameraPosition().target)
.zoom(mMap.getCameraPosition().zoom)
.bearing(270)
.build()));
But when I do this some markers won't show up.