@@ -60,6 +60,7 @@ import com.mapbox.navigation.ui.maps.util.CacheResultUtils.cacheResult
60
60
import com.mapbox.navigation.ui.utils.internal.ifNonNull
61
61
import com.mapbox.navigation.utils.internal.InternalJobControlFactory
62
62
import com.mapbox.navigation.utils.internal.logE
63
+ import com.mapbox.navigation.utils.internal.logI
63
64
import com.mapbox.navigation.utils.internal.logW
64
65
import com.mapbox.navigation.utils.internal.parallelMap
65
66
import kotlinx.coroutines.Deferred
@@ -663,9 +664,11 @@ class MapboxRouteLineApi(
663
664
lastLocationPoint = null
664
665
routeLineOptions.vanishingRouteLine?.vanishPointOffset = 0.0
665
666
activeLegIndex = INVALID_ACTIVE_LEG_INDEX
667
+ logI(" Updated leg index to $activeLegIndex (from clearRouteLine)" , LOG_CATEGORY )
666
668
routes.clear()
667
669
routeFeatureData.clear()
668
670
routeLineExpressionData = emptyList()
671
+ logI(" Cleared route line expression data (from clearRouteLine)" , LOG_CATEGORY )
669
672
resetCaches()
670
673
671
674
consumer.accept(
@@ -823,6 +826,12 @@ class MapboxRouteLineApi(
823
826
routeProgressUpdatesQueue.addJob(
824
827
CoalescingBlockingQueue .Item (
825
828
{
829
+ logI(
830
+ " Update with route progress. " +
831
+ " Leg index: ${routeProgress.currentLegProgress?.legIndex} , " +
832
+ " state: ${routeProgress.currentState} " ,
833
+ LOG_CATEGORY
834
+ )
826
835
val currentPrimaryRoute = primaryRoute
827
836
if (currentPrimaryRoute == null ) {
828
837
val msg =
@@ -845,6 +854,12 @@ class MapboxRouteLineApi(
845
854
updateVanishingPointState(routeProgress.currentState)
846
855
847
856
val currentLegIndex = routeProgress.currentLegProgress?.legIndex
857
+ logI(
858
+ " Calculate routeLineMaskingLayerDynamicData. " +
859
+ " Leg index: ${routeProgress.currentLegProgress?.legIndex} , " +
860
+ " state: ${routeProgress.currentState} , activeLegIndex: $activeLegIndex " ,
861
+ LOG_CATEGORY
862
+ )
848
863
val routeLineMaskingLayerDynamicData =
849
864
when ((currentLegIndex ? : INVALID_ACTIVE_LEG_INDEX ) != activeLegIndex) {
850
865
true -> getRouteLineDynamicDataForMaskingLayers(
@@ -855,6 +870,7 @@ class MapboxRouteLineApi(
855
870
}
856
871
val legChange = (currentLegIndex ? : 0 ) > activeLegIndex
857
872
activeLegIndex = currentLegIndex ? : INVALID_ACTIVE_LEG_INDEX
873
+ logI(" Update leg index to $activeLegIndex (from route progress update)" , LOG_CATEGORY )
858
874
859
875
// If the de-emphasize inactive route legs feature is enabled and the vanishing route line
860
876
// feature is enabled and the active leg index has changed, then calling the
@@ -1036,6 +1052,11 @@ class MapboxRouteLineApi(
1036
1052
return ifNonNull(route, routeProgress.currentLegProgress) { navRoute, currentLegProgress ->
1037
1053
val numLegs = navRoute.directionsRoute.legs()?.size ? : 0
1038
1054
val legIndex = currentLegProgress.legIndex
1055
+ logI(
1056
+ " getRouteLineDynamicDataForMaskingLayers for legIndex: $legIndex , " +
1057
+ " numLegs: $numLegs , data size: ${routeLineExpressionData.size} " ,
1058
+ LOG_CATEGORY
1059
+ )
1039
1060
if (numLegs > 1 && legIndex < numLegs) {
1040
1061
getRouteLineDynamicDataForMaskingLayers(routeLineExpressionData, legIndex)
1041
1062
} else {
@@ -1421,6 +1442,7 @@ class MapboxRouteLineApi(
1421
1442
primaryRoute = distinctNewRoutes.firstOrNull()
1422
1443
MapboxRouteLineUtils .trimRouteDataCacheToSize(size = distinctNewRoutes.size)
1423
1444
this .activeLegIndex = INVALID_ACTIVE_LEG_INDEX
1445
+ logI(" Updated activeLegIndex to $activeLegIndex (from setNewRouteData)" , LOG_CATEGORY )
1424
1446
1425
1447
preWarmRouteCaches(
1426
1448
distinctNewRoutes,
@@ -1653,10 +1675,18 @@ class MapboxRouteLineApi(
1653
1675
when (legsCount > 1 ) {
1654
1676
true -> {
1655
1677
routeLineExpressionData = deferred.await()
1678
+ logI(
1679
+ " Inited route line expression data: ${routeLineExpressionData.size} sync" ,
1680
+ LOG_CATEGORY
1681
+ )
1656
1682
}
1657
1683
false -> {
1658
1684
jobControl.scope.launch(Dispatchers .Main ) {
1659
1685
routeLineExpressionData = deferred.await()
1686
+ logI(
1687
+ " Inited route line expression data: ${routeLineExpressionData.size} async" ,
1688
+ LOG_CATEGORY
1689
+ )
1660
1690
}
1661
1691
}
1662
1692
}
0 commit comments