11package com.mapbox.navigation.ui.maps.camera.data
22
33import android.location.Location
4+ import android.util.Log
45import androidx.annotation.UiThread
56import com.mapbox.api.directions.v5.models.DirectionsRoute
67import com.mapbox.api.directions.v5.models.LegStep
@@ -16,6 +17,7 @@ import com.mapbox.navigation.base.route.NavigationRoute
1617import com.mapbox.navigation.base.route.toNavigationRoute
1718import com.mapbox.navigation.base.trip.model.RouteProgress
1819import com.mapbox.navigation.core.MapboxNavigation
20+ import com.mapbox.navigation.ui.maps.camera.LogTag
1921import com.mapbox.navigation.ui.maps.camera.NavigationCamera
2022import com.mapbox.navigation.ui.maps.camera.data.ViewportDataSourceProcessor.getMapAnchoredPaddingFromUserPadding
2123import com.mapbox.navigation.ui.maps.camera.data.ViewportDataSourceProcessor.getPitchFallbackFromRouteProgress
@@ -558,6 +560,7 @@ class MapboxNavigationViewportDataSource(
558560 * Provide additional points that should be fitted into the following frame update.
559561 */
560562 fun additionalPointsToFrameForFollowing (points : List <Point >) {
563+ Log .i(LogTag .TAG , " additionalPointsToFrameForFollowing: $points " )
561564 additionalPointsToFrameForFollowing = ArrayList (points)
562565 }
563566
@@ -577,6 +580,7 @@ class MapboxNavigationViewportDataSource(
577580 * @see [evaluate]
578581 */
579582 fun followingCenterPropertyOverride (value : Point ? ) {
583+ Log .i(LogTag .TAG , " followingCenterPropertyOverride: $value " )
580584 followingCenterProperty.override = value
581585 }
582586
@@ -589,6 +593,7 @@ class MapboxNavigationViewportDataSource(
589593 * @see [evaluate]
590594 */
591595 fun followingZoomPropertyOverride (value : Double? ) {
596+ Log .i(LogTag .TAG , " followingZoomPropertyOverride: $value " )
592597 followingZoomProperty.override = value
593598 }
594599
@@ -601,6 +606,7 @@ class MapboxNavigationViewportDataSource(
601606 * @see [evaluate]
602607 */
603608 fun followingBearingPropertyOverride (value : Double? ) {
609+ Log .i(LogTag .TAG , " followingBearingPropertyOverride: $value " )
604610 followingBearingProperty.override = value
605611 }
606612
@@ -613,6 +619,7 @@ class MapboxNavigationViewportDataSource(
613619 * @see [evaluate]
614620 */
615621 fun followingPitchPropertyOverride (value : Double? ) {
622+ Log .i(LogTag .TAG , " followingPitchPropertyOverride: $value " )
616623 followingPitchProperty.override = value
617624 }
618625
@@ -699,6 +706,8 @@ class MapboxNavigationViewportDataSource(
699706 // needs to be added here to be taken into account for bearing smoothing
700707 pointsForFollowing.addAll(additionalPointsToFrameForFollowing)
701708
709+ Log .i(LogTag .TAG , " Target location: $localTargetLocation , pointsToFrame: $pointsForFollowing " )
710+
702711 if (pointsForFollowing.isEmpty()) {
703712 options.followingFrameOptions.run {
704713 val cameraState = mapboxMap.cameraState
@@ -734,6 +743,7 @@ class MapboxNavigationViewportDataSource(
734743 options.followingFrameOptions.maximizeViewableGeometryWhenPitchZero &&
735744 followingPitchProperty.get() == ZERO_PITCH
736745 ) {
746+ Log .i(LogTag .TAG , " maximizeViewableGeometryWhenPitchZero=true, \n points to frame: $pointsForFollowing , \n padding: $followingPadding " )
737747 mapboxMap.cameraForCoordinates(
738748 pointsForFollowing,
739749 followingPadding,
@@ -758,6 +768,7 @@ class MapboxNavigationViewportDataSource(
758768 .pitch(followingPitchProperty.get())
759769 .zoom(cameraState.zoom)
760770 .build()
771+ Log .i(LogTag .TAG , " maximizeViewableGeometryWhenPitchZero=false, \n points to frame: $pointsForFollowing , \n camera center: ${fallbackCameraOptions.center} \n map size: $mapSize , followingPadding=${followingPadding} , screenBox=$screenBox , resultingPadding=$padding , zoom=${fallbackCameraOptions.zoom} " )
761772 if (pointsForFollowing.size > 1 ) {
762773 mapboxMap.cameraForCoordinates(
763774 pointsForFollowing,
0 commit comments