I need to move the camera to my location slowly in android, i use the code below but the camera change from position to another like switching between pages. this is my code
CameraPosition cameraPosition = new CameraPosition.Builder()
.target(location1)
.zoom(16)
.bearing(90)
.tilt(30)
.build();
googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition), 10000, null);
CameraUpdate center=
CameraUpdateFactory.newLatLng(location1);
// CameraUpdate zoomcam=CameraUpdateFactory.zoomTo(zoom);
googleMap.moveCamera(center);
To apply a CameraUpdate to the map, you can either move the camera instantly or animate the camera smoothly. To move the camera instantly with the given CameraUpdate , you can call GoogleMap. moveCamera(CameraUpdate) . The CameraUpdate describing where to move the camera.
To calibrate with Live View, you will need to point your phone cameras at buildings and signs across the street. The new 'Calibrate with Live View' option is now available on ARCore-compatible Android smartphones running the latest version of Google Maps.
An immutable class that aggregates all camera position parameters such as location, zoom level, tilt angle, and bearing. Use CameraPosition. Builder to construct a CameraPosition instance, which you can then use in conjunction with CameraUpdateFactory .
Google Maps offers two views for walking navigation: the 2D map and Live View. With Live View, you get directions placed in the real world and on a mini map at the bottom of your screen. You can use Live View navigation during the walking portion of any type of trip.
Just remove googleMap.moveCamera(center);
.
Use only googleMap.animateCamera(center);
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With