mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
Re-use current zoom level on camera updates
This commit is contained in:
parent
aa61a0673f
commit
34579ca125
1 changed files with 4 additions and 4 deletions
|
|
@ -251,7 +251,7 @@ public class NearbyMapFragment extends DaggerFragment {
|
||||||
new LatLng(curMapBoxLatLng.getLatitude()- CAMERA_TARGET_SHIFT_FACTOR,
|
new LatLng(curMapBoxLatLng.getLatitude()- CAMERA_TARGET_SHIFT_FACTOR,
|
||||||
curMapBoxLatLng.getLongitude())
|
curMapBoxLatLng.getLongitude())
|
||||||
: curMapBoxLatLng ) // Sets the new camera position
|
: curMapBoxLatLng ) // Sets the new camera position
|
||||||
.zoom(11) // Same zoom level
|
.zoom(mapboxMap.getMaxZoomLevel()) // Same zoom level
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
mapboxMap.animateCamera(CameraUpdateFactory
|
mapboxMap.animateCamera(CameraUpdateFactory
|
||||||
|
|
@ -270,7 +270,7 @@ public class NearbyMapFragment extends DaggerFragment {
|
||||||
.target(new LatLng(curLatLng.getLatitude() - CAMERA_TARGET_SHIFT_FACTOR,
|
.target(new LatLng(curLatLng.getLatitude() - CAMERA_TARGET_SHIFT_FACTOR,
|
||||||
curLatLng.getLongitude())) // Sets the new camera target above
|
curLatLng.getLongitude())) // Sets the new camera target above
|
||||||
// current to make it visible when sheet is expanded
|
// current to make it visible when sheet is expanded
|
||||||
.zoom(11) // Same zoom level
|
.zoom(mapboxMap.getMaxZoomLevel()) // Same zoom level
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -278,7 +278,7 @@ public class NearbyMapFragment extends DaggerFragment {
|
||||||
position = new CameraPosition.Builder()
|
position = new CameraPosition.Builder()
|
||||||
.target(new LatLng(curLatLng.getLatitude(),
|
.target(new LatLng(curLatLng.getLatitude(),
|
||||||
curLatLng.getLongitude())) // Sets the new camera target to curLatLng
|
curLatLng.getLongitude())) // Sets the new camera target to curLatLng
|
||||||
.zoom(11) // Same zoom level
|
.zoom(mapboxMap.getMaxZoomLevel()) // Same zoom level
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
mapboxMap.animateCamera(CameraUpdateFactory
|
mapboxMap.animateCamera(CameraUpdateFactory
|
||||||
|
|
@ -391,7 +391,7 @@ public class NearbyMapFragment extends DaggerFragment {
|
||||||
.attributionEnabled(false)
|
.attributionEnabled(false)
|
||||||
.camera(new CameraPosition.Builder()
|
.camera(new CameraPosition.Builder()
|
||||||
.target(new LatLng(curLatLng.getLatitude(), curLatLng.getLongitude()))
|
.target(new LatLng(curLatLng.getLatitude(), curLatLng.getLongitude()))
|
||||||
.zoom(11)
|
.zoom(11) //Initial zoom level choosen
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
// create map
|
// create map
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue