Skip to content

Commit

Permalink
address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Guardiola31337 committed Aug 3, 2018
1 parent 3dc22c5 commit 9fdc873
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.mapbox.api.directions.v5.models.DirectionsRoute;
import com.mapbox.geojson.Point;
import com.mapbox.mapboxsdk.Mapbox;
import com.mapbox.services.android.navigation.ui.v5.camera.DynamicCamera;
import com.mapbox.services.android.navigation.ui.v5.feedback.FeedbackItem;
import com.mapbox.services.android.navigation.ui.v5.instruction.BannerInstructionModel;
import com.mapbox.services.android.navigation.ui.v5.instruction.InstructionModel;
Expand All @@ -35,6 +36,7 @@
import com.mapbox.services.android.navigation.v5.navigation.MapboxNavigationOptions;
import com.mapbox.services.android.navigation.v5.navigation.NavigationEventListener;
import com.mapbox.services.android.navigation.v5.navigation.NavigationTimeFormat;
import com.mapbox.services.android.navigation.v5.navigation.camera.Camera;
import com.mapbox.services.android.navigation.v5.navigation.metrics.FeedbackEvent;
import com.mapbox.services.android.navigation.v5.offroute.OffRouteListener;
import com.mapbox.services.android.navigation.v5.route.FasterRouteListener;
Expand Down Expand Up @@ -97,7 +99,11 @@ public void onDestroy(boolean isChangingConfigurations) {
deactivateInstructionPlayer();
endNavigation();
}
navigation.setCameraEngine(null);
Camera cameraEngine = navigation.getCameraEngine();
boolean isDynamicCamera = cameraEngine instanceof DynamicCamera;
if (isDynamicCamera) {
((DynamicCamera) cameraEngine).clearMap();
}
navigationViewEventDispatcher = null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public void forceResetZoomLevel() {
forceUpdateZoom = true;
}

public void clearMap() {
mapboxMap = null;
}

/**
* Creates a tilt value based on the distance remaining for the current {@link LegStep}.
* <p>
Expand Down

0 comments on commit 9fdc873

Please sign in to comment.