Skip to content

Commit 0d86931

Browse files
committed
add experimental route line logs
1 parent 9da2a96 commit 0d86931

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

gradle/artifact-settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ext {
1212
mapboxArtifactLicenseUrl = 'https://www.mapbox.com/legal/tos/'
1313
snapshot = project.hasProperty("snapshot") ? project.property("snapshot").toBoolean() : false
1414
releaseTagPrefix = project.hasProperty('RELEASE_TAG_PREFIX') ? project.property('RELEASE_TAG_PREFIX') : 'v'
15-
versionName = getVersionName()
15+
versionName = '2.13.0-route-line-SNAPSHOT'
1616
}
1717

1818
def getVersionName() {

libnavui-maps/src/main/java/com/mapbox/navigation/ui/maps/route/line/api/MapboxRouteLineApi.kt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ import com.mapbox.navigation.ui.maps.util.CacheResultUtils.cacheResult
5959
import com.mapbox.navigation.ui.utils.internal.ifNonNull
6060
import com.mapbox.navigation.utils.internal.InternalJobControlFactory
6161
import com.mapbox.navigation.utils.internal.logE
62+
import com.mapbox.navigation.utils.internal.logI
6263
import com.mapbox.navigation.utils.internal.logW
6364
import com.mapbox.navigation.utils.internal.parallelMap
6465
import kotlinx.coroutines.Deferred
@@ -637,9 +638,11 @@ class MapboxRouteLineApi(
637638
lastLocationPoint = null
638639
routeLineOptions.vanishingRouteLine?.vanishPointOffset = 0.0
639640
activeLegIndex = INVALID_ACTIVE_LEG_INDEX
641+
logI("Updated leg index to $activeLegIndex (from clearRouteLine)", LOG_CATEGORY)
640642
routes.clear()
641643
routeFeatureData.clear()
642644
routeLineExpressionData = emptyList()
645+
logI("Cleared route line expression data (from clearRouteLine)", LOG_CATEGORY)
643646
resetCaches()
644647

645648
consumer.accept(
@@ -794,6 +797,12 @@ class MapboxRouteLineApi(
794797
routeProgress: RouteProgress,
795798
consumer: MapboxNavigationConsumer<Expected<RouteLineError, RouteLineUpdateValue>>
796799
) {
800+
logI(
801+
"Update with route progress. " +
802+
"Leg index: ${routeProgress.currentLegProgress?.legIndex}, " +
803+
"state: ${routeProgress.currentState}",
804+
LOG_CATEGORY
805+
)
797806
val currentPrimaryRoute = primaryRoute
798807
if (currentPrimaryRoute == null) {
799808
val msg = "You're calling #updateWithRouteProgress without any routes being set."
@@ -816,6 +825,12 @@ class MapboxRouteLineApi(
816825
updateUpcomingRoutePointIndex(routeProgress)
817826
updateVanishingPointState(routeProgress.currentState)
818827

828+
logI(
829+
"Calculate routeLineMaskingLayerDynamicData. " +
830+
"Leg index: ${routeProgress.currentLegProgress?.legIndex}, " +
831+
"state: ${routeProgress.currentState}, activeLegIndex: $activeLegIndex",
832+
LOG_CATEGORY
833+
)
819834
val routeLineMaskingLayerDynamicData = when (
820835
(routeProgress.currentLegProgress?.legIndex ?: INVALID_ACTIVE_LEG_INDEX) !=
821836
activeLegIndex
@@ -825,6 +840,7 @@ class MapboxRouteLineApi(
825840
}
826841
val legChange = (routeProgress.currentLegProgress?.legIndex ?: 0) > activeLegIndex
827842
activeLegIndex = routeProgress.currentLegProgress?.legIndex ?: INVALID_ACTIVE_LEG_INDEX
843+
logI("Update leg index to $activeLegIndex (from route progress update)", LOG_CATEGORY)
828844

829845
// If the de-emphasize inactive route legs feature is enabled and the vanishing route line
830846
// feature is enabled and the active leg index has changed, then calling the
@@ -987,6 +1003,11 @@ class MapboxRouteLineApi(
9871003
return ifNonNull(route, routeProgress.currentLegProgress) { navRoute, currentLegProgress ->
9881004
val numLegs = navRoute.directionsRoute.legs()?.size ?: 0
9891005
val legIndex = currentLegProgress.legIndex
1006+
logI(
1007+
"getRouteLineDynamicDataForMaskingLayers for legIndex: $legIndex, " +
1008+
"numLegs: $numLegs, data size: ${routeLineExpressionData.size}",
1009+
LOG_CATEGORY
1010+
)
9901011
if (numLegs > 1 && legIndex < numLegs) {
9911012
getRouteLineDynamicDataForMaskingLayers(routeLineExpressionData, legIndex)
9921013
} else {
@@ -1371,6 +1392,7 @@ class MapboxRouteLineApi(
13711392
primaryRoute = distinctNewRoutes.firstOrNull()
13721393
MapboxRouteLineUtils.trimRouteDataCacheToSize(size = distinctNewRoutes.size)
13731394
this.activeLegIndex = INVALID_ACTIVE_LEG_INDEX
1395+
logI("Updated activeLegIndex to $activeLegIndex (from setNewRouteData)", LOG_CATEGORY)
13741396

13751397
preWarmRouteCaches(
13761398
distinctNewRoutes,
@@ -1604,10 +1626,18 @@ class MapboxRouteLineApi(
16041626
) {
16051627
true -> {
16061628
routeLineExpressionData = deferred.await()
1629+
logI(
1630+
"Inited route line expression data: ${routeLineExpressionData.size} sync",
1631+
LOG_CATEGORY
1632+
)
16071633
}
16081634
false -> {
16091635
jobControl.scope.launch(Dispatchers.Main) {
16101636
routeLineExpressionData = deferred.await()
1637+
logI(
1638+
"Inited route line expression data: ${routeLineExpressionData.size} async",
1639+
LOG_CATEGORY
1640+
)
16111641
}
16121642
}
16131643
}

0 commit comments

Comments
 (0)