Skip to content

Commit

Permalink
more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
dzinad committed May 25, 2023
1 parent 0e0c1f7 commit 6d14385
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle/artifact-settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ext {
mapboxArtifactLicenseUrl = 'https://www.mapbox.com/legal/tos/'
snapshot = project.hasProperty("snapshot") ? project.property("snapshot").toBoolean() : false
releaseTagPrefix = project.hasProperty('RELEASE_TAG_PREFIX') ? project.property('RELEASE_TAG_PREFIX') : 'v'
versionName = '2.13.0-route-line-2-SNAPSHOT'
versionName = '2.13.0-route-line-3-SNAPSHOT'
}

def getVersionName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ class MapboxRouteLineApi(
trafficBackfillRoadClasses.addAll(
routeLineOptions.resourceProvider.trafficBackfillRoadClasses
)
logI("BelowLayerId: ${routeLineOptions.routeLineBelowLayerId}", LOG_CATEGORY)
}

/**
Expand Down Expand Up @@ -1021,6 +1022,8 @@ class MapboxRouteLineApi(
routeLineOptions.resourceProvider.routeLineColorResources,
restrictedExpressionData
)
logI("Masking layer main exp: $mainExp", LOG_CATEGORY)
logI("Masking layer traffic exp: $trafficExp", LOG_CATEGORY)

return RouteLineDynamicData(
{ mainExp },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import com.mapbox.navigation.ui.maps.route.line.model.RouteLineUpdateValue
import com.mapbox.navigation.ui.maps.route.line.model.RouteSetValue
import com.mapbox.navigation.utils.internal.ifNonNull
import com.mapbox.navigation.utils.internal.logE
import com.mapbox.navigation.utils.internal.logI
import org.jetbrains.annotations.TestOnly

/**
Expand Down Expand Up @@ -169,6 +170,10 @@ class MapboxRouteLineView @VisibleForTesting internal constructor(
Pair(MapboxRouteLineUtils.layerGroup3SourceKey, RouteLineFeatureId(null))
)

init {
logI("BelowLayerId: ${options.routeLineBelowLayerId}", TAG)
}

@TestOnly
internal fun initPrimaryRouteLineLayerGroup(layerIds: Set<String>) {
primaryRouteLineLayerGroup = layerIds
Expand Down Expand Up @@ -244,6 +249,10 @@ class MapboxRouteLineView @VisibleForTesting internal constructor(
callback: RoutesRenderedCallbackWrapper?
) {
rebuildSourcesAndLayersIfNeeded(style)
logI("Layers size: ${style.styleLayers.size}", TAG)
style.styleLayers.forEach {
logI("${it.id} properties: ${style.getStyleLayerProperties(it.id).value}", TAG)
}
val primaryRouteTrafficVisibility = getTrafficVisibility(style)
val primaryRouteVisibility = getPrimaryRouteVisibility(style)
val alternativeRouteVisibility = getAlternativeRoutesVisibility(style)
Expand Down Expand Up @@ -430,6 +439,11 @@ class MapboxRouteLineView @VisibleForTesting internal constructor(
.forEach { mutationCommand ->
mutationCommand()
}

logI("Layers moved. New order:", TAG)
style.styleLayers.forEach {
logI("After render ${it.id} properties: ${style.getStyleLayerProperties(it.id).value}", TAG)
}
}

private fun getRelatedSourceKey(
Expand Down Expand Up @@ -459,6 +473,7 @@ class MapboxRouteLineView @VisibleForTesting internal constructor(
}
}

val trafficProvider = it.routeLineMaskingLayerDynamicData?.trafficExpressionProvider
ifNonNull(it.routeLineMaskingLayerDynamicData) { overlayData ->
overlayData.restrictedSectionExpressionProvider?.apply {
getExpressionUpdateFun(MASKING_LAYER_RESTRICTED, this)(style)
Expand Down Expand Up @@ -490,9 +505,13 @@ class MapboxRouteLineView @VisibleForTesting internal constructor(
if (
overlayData.baseExpressionProvider !is RouteLineTrimExpressionProvider
) {
logI("Move layers up.", TAG)
getMaskingLayerMoveCommands(style).forEach { mutationCommand ->
mutationCommand()
}
style.styleLayers.forEach {
logI("Moved up ${it.id} properties: ${style.getStyleLayerProperties(it.id).value}", TAG)
}
}
}
}
Expand Down

0 comments on commit 6d14385

Please sign in to comment.