1
1
package com.mapbox.navigation.ui.maps.camera.data
2
2
3
3
import android.location.Location
4
+ import android.util.Log
4
5
import androidx.annotation.UiThread
5
6
import com.mapbox.api.directions.v5.models.DirectionsRoute
6
7
import com.mapbox.api.directions.v5.models.LegStep
@@ -16,6 +17,7 @@ import com.mapbox.navigation.base.route.NavigationRoute
16
17
import com.mapbox.navigation.base.route.toNavigationRoute
17
18
import com.mapbox.navigation.base.trip.model.RouteProgress
18
19
import com.mapbox.navigation.core.MapboxNavigation
20
+ import com.mapbox.navigation.ui.maps.camera.LogTag
19
21
import com.mapbox.navigation.ui.maps.camera.NavigationCamera
20
22
import com.mapbox.navigation.ui.maps.camera.data.ViewportDataSourceProcessor.getMapAnchoredPaddingFromUserPadding
21
23
import com.mapbox.navigation.ui.maps.camera.data.ViewportDataSourceProcessor.getPitchFallbackFromRouteProgress
@@ -558,6 +560,7 @@ class MapboxNavigationViewportDataSource(
558
560
* Provide additional points that should be fitted into the following frame update.
559
561
*/
560
562
fun additionalPointsToFrameForFollowing (points : List <Point >) {
563
+ Log .i(LogTag .TAG , " additionalPointsToFrameForFollowing: $points " )
561
564
additionalPointsToFrameForFollowing = ArrayList (points)
562
565
}
563
566
@@ -577,6 +580,7 @@ class MapboxNavigationViewportDataSource(
577
580
* @see [evaluate]
578
581
*/
579
582
fun followingCenterPropertyOverride (value : Point ? ) {
583
+ Log .i(LogTag .TAG , " followingCenterPropertyOverride: $value " )
580
584
followingCenterProperty.override = value
581
585
}
582
586
@@ -589,6 +593,7 @@ class MapboxNavigationViewportDataSource(
589
593
* @see [evaluate]
590
594
*/
591
595
fun followingZoomPropertyOverride (value : Double? ) {
596
+ Log .i(LogTag .TAG , " followingZoomPropertyOverride: $value " )
592
597
followingZoomProperty.override = value
593
598
}
594
599
@@ -601,6 +606,7 @@ class MapboxNavigationViewportDataSource(
601
606
* @see [evaluate]
602
607
*/
603
608
fun followingBearingPropertyOverride (value : Double? ) {
609
+ Log .i(LogTag .TAG , " followingBearingPropertyOverride: $value " )
604
610
followingBearingProperty.override = value
605
611
}
606
612
@@ -613,6 +619,7 @@ class MapboxNavigationViewportDataSource(
613
619
* @see [evaluate]
614
620
*/
615
621
fun followingPitchPropertyOverride (value : Double? ) {
622
+ Log .i(LogTag .TAG , " followingPitchPropertyOverride: $value " )
616
623
followingPitchProperty.override = value
617
624
}
618
625
@@ -699,6 +706,8 @@ class MapboxNavigationViewportDataSource(
699
706
// needs to be added here to be taken into account for bearing smoothing
700
707
pointsForFollowing.addAll(additionalPointsToFrameForFollowing)
701
708
709
+ Log .i(LogTag .TAG , " Target location: $localTargetLocation , pointsToFrame: $pointsForFollowing " )
710
+
702
711
if (pointsForFollowing.isEmpty()) {
703
712
options.followingFrameOptions.run {
704
713
val cameraState = mapboxMap.cameraState
@@ -734,6 +743,7 @@ class MapboxNavigationViewportDataSource(
734
743
options.followingFrameOptions.maximizeViewableGeometryWhenPitchZero &&
735
744
followingPitchProperty.get() == ZERO_PITCH
736
745
) {
746
+ Log .i(LogTag .TAG , " maximizeViewableGeometryWhenPitchZero=true, \n points to frame: $pointsForFollowing , \n padding: $followingPadding " )
737
747
mapboxMap.cameraForCoordinates(
738
748
pointsForFollowing,
739
749
followingPadding,
@@ -758,6 +768,7 @@ class MapboxNavigationViewportDataSource(
758
768
.pitch(followingPitchProperty.get())
759
769
.zoom(cameraState.zoom)
760
770
.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} " )
761
772
if (pointsForFollowing.size > 1 ) {
762
773
mapboxMap.cameraForCoordinates(
763
774
pointsForFollowing,
0 commit comments