Hello,
I was reading through this post http://findnerd.com/list/view/Problem-in-Google-map-rotation-in-Android/23827/
and was searching for a solution of rotation issue. I want to implement same as in uber app. https://drive.google.com/open?id=1J3jLEJb7_tj6fBOFpaXODYE1fMCBy_TJ
If anyone have solved this then please reply here.
I am using following code for rotation and animation:
public void animateMarker(final Marker marker, final LatLng toPosition) {
final Handler handler = new Handler();
final long start = SystemClock.uptimeMillis();
Projection proj = mGoogleMap.getProjection();
Point startPoint = proj.toScreenLocation(carMarker.getPosition());
final LatLng startLatLng = proj.fromScreenLocation(startPoint);
final long duration = 800;//500
final Interpolator interpolator = new LinearInterpolator();
handler.post(new Runnable() {
@Override
public void run() {
long elapsed = SystemClock.uptimeMillis() - start;
float t = interpolator.getInterpolation((float) elapsed / duration);
if (!isMarkerRotating) {
final Handler handler = new Handler();
final long start = SystemClock.uptimeMillis();
final float startRotation = fromRotation;
final long duration = 1000;
final Interpolator interpolator = new LinearInterpolator();
0 Answer(s)