Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Call cancelTransitions when setting map position, zoom level, or dire…
Browse files Browse the repository at this point in the history
…ction.

Fixes # 2296
  • Loading branch information
Leith Bade authored and incanus committed Sep 11, 2015
1 parent 953fcfd commit d894bb7
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ public void setCenterCoordinate(LatLng centerCoordinate) {

public void setCenterCoordinate(LatLng centerCoordinate, boolean animated) {
long duration = animated ? ANIMATION_DURATION : 0;
mNativeMapView.cancelTransitions();
mNativeMapView.setLatLng(centerCoordinate, duration);
}

Expand All @@ -638,6 +639,7 @@ public void setCenterCoordinate(LatLngZoom centerCoordinate) {
public void setCenterCoordinate(LatLngZoom centerCoordinate,
boolean animated) {
long duration = animated ? ANIMATION_DURATION : 0;
mNativeMapView.cancelTransitions();
mNativeMapView.setLatLngZoom(centerCoordinate, duration);
}

Expand All @@ -660,14 +662,17 @@ public void setDirection(double direction) {

public void setDirection(double direction, boolean animated) {
long duration = animated ? ANIMATION_DURATION : 0;
mNativeMapView.cancelTransitions();
mNativeMapView.setBearing(-direction, duration);
}

public void resetPosition() {
mNativeMapView.cancelTransitions();
mNativeMapView.resetPosition();
}

public void resetNorth() {
mNativeMapView.cancelTransitions();
mNativeMapView.resetNorth();
}

Expand All @@ -681,6 +686,7 @@ public void setZoomLevel(double zoomLevel) {

public void setZoomLevel(double zoomLevel, boolean animated) {
long duration = animated ? ANIMATION_DURATION : 0;
mNativeMapView.cancelTransitions();
mNativeMapView.setZoom(zoomLevel, duration);
}

Expand Down

0 comments on commit d894bb7

Please sign in to comment.