@@ -59,6 +59,7 @@ import com.mapbox.navigation.ui.maps.util.CacheResultUtils.cacheResult
59
59
import com.mapbox.navigation.ui.utils.internal.ifNonNull
60
60
import com.mapbox.navigation.utils.internal.InternalJobControlFactory
61
61
import com.mapbox.navigation.utils.internal.logE
62
+ import com.mapbox.navigation.utils.internal.logI
62
63
import com.mapbox.navigation.utils.internal.logW
63
64
import com.mapbox.navigation.utils.internal.parallelMap
64
65
import kotlinx.coroutines.Deferred
@@ -637,9 +638,11 @@ class MapboxRouteLineApi(
637
638
lastLocationPoint = null
638
639
routeLineOptions.vanishingRouteLine?.vanishPointOffset = 0.0
639
640
activeLegIndex = INVALID_ACTIVE_LEG_INDEX
641
+ logI(" Updated leg index to $activeLegIndex (from clearRouteLine)" , LOG_CATEGORY )
640
642
routes.clear()
641
643
routeFeatureData.clear()
642
644
routeLineExpressionData = emptyList()
645
+ logI(" Cleared route line expression data (from clearRouteLine)" , LOG_CATEGORY )
643
646
resetCaches()
644
647
645
648
consumer.accept(
@@ -794,6 +797,12 @@ class MapboxRouteLineApi(
794
797
routeProgress : RouteProgress ,
795
798
consumer : MapboxNavigationConsumer <Expected <RouteLineError , RouteLineUpdateValue >>
796
799
) {
800
+ logI(
801
+ " Update with route progress. " +
802
+ " Leg index: ${routeProgress.currentLegProgress?.legIndex} , " +
803
+ " state: ${routeProgress.currentState} " ,
804
+ LOG_CATEGORY
805
+ )
797
806
val currentPrimaryRoute = primaryRoute
798
807
if (currentPrimaryRoute == null ) {
799
808
val msg = " You're calling #updateWithRouteProgress without any routes being set."
@@ -816,6 +825,12 @@ class MapboxRouteLineApi(
816
825
updateUpcomingRoutePointIndex(routeProgress)
817
826
updateVanishingPointState(routeProgress.currentState)
818
827
828
+ logI(
829
+ " Calculate routeLineMaskingLayerDynamicData. " +
830
+ " Leg index: ${routeProgress.currentLegProgress?.legIndex} , " +
831
+ " state: ${routeProgress.currentState} , activeLegIndex: $activeLegIndex " ,
832
+ LOG_CATEGORY
833
+ )
819
834
val routeLineMaskingLayerDynamicData = when (
820
835
(routeProgress.currentLegProgress?.legIndex ? : INVALID_ACTIVE_LEG_INDEX ) !=
821
836
activeLegIndex
@@ -825,6 +840,7 @@ class MapboxRouteLineApi(
825
840
}
826
841
val legChange = (routeProgress.currentLegProgress?.legIndex ? : 0 ) > activeLegIndex
827
842
activeLegIndex = routeProgress.currentLegProgress?.legIndex ? : INVALID_ACTIVE_LEG_INDEX
843
+ logI(" Update leg index to $activeLegIndex (from route progress update)" , LOG_CATEGORY )
828
844
829
845
// If the de-emphasize inactive route legs feature is enabled and the vanishing route line
830
846
// feature is enabled and the active leg index has changed, then calling the
@@ -987,6 +1003,11 @@ class MapboxRouteLineApi(
987
1003
return ifNonNull(route, routeProgress.currentLegProgress) { navRoute, currentLegProgress ->
988
1004
val numLegs = navRoute.directionsRoute.legs()?.size ? : 0
989
1005
val legIndex = currentLegProgress.legIndex
1006
+ logI(
1007
+ " getRouteLineDynamicDataForMaskingLayers for legIndex: $legIndex , " +
1008
+ " numLegs: $numLegs , data size: ${routeLineExpressionData.size} " ,
1009
+ LOG_CATEGORY
1010
+ )
990
1011
if (numLegs > 1 && legIndex < numLegs) {
991
1012
getRouteLineDynamicDataForMaskingLayers(routeLineExpressionData, legIndex)
992
1013
} else {
@@ -1371,6 +1392,7 @@ class MapboxRouteLineApi(
1371
1392
primaryRoute = distinctNewRoutes.firstOrNull()
1372
1393
MapboxRouteLineUtils .trimRouteDataCacheToSize(size = distinctNewRoutes.size)
1373
1394
this .activeLegIndex = INVALID_ACTIVE_LEG_INDEX
1395
+ logI(" Updated activeLegIndex to $activeLegIndex (from setNewRouteData)" , LOG_CATEGORY )
1374
1396
1375
1397
preWarmRouteCaches(
1376
1398
distinctNewRoutes,
@@ -1604,10 +1626,18 @@ class MapboxRouteLineApi(
1604
1626
) {
1605
1627
true -> {
1606
1628
routeLineExpressionData = deferred.await()
1629
+ logI(
1630
+ " Inited route line expression data: ${routeLineExpressionData.size} sync" ,
1631
+ LOG_CATEGORY
1632
+ )
1607
1633
}
1608
1634
false -> {
1609
1635
jobControl.scope.launch(Dispatchers .Main ) {
1610
1636
routeLineExpressionData = deferred.await()
1637
+ logI(
1638
+ " Inited route line expression data: ${routeLineExpressionData.size} async" ,
1639
+ LOG_CATEGORY
1640
+ )
1611
1641
}
1612
1642
}
1613
1643
}
0 commit comments