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 5927efb
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 66 deletions.
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,8 @@ class MapboxRouteLineApi(
trafficBackfillRoadClasses.addAll(
routeLineOptions.resourceProvider.trafficBackfillRoadClasses
)
logI("BelowLayerId: ${routeLineOptions.routeLineBelowLayerId}", LOG_CATEGORY)
logI("All options: $routeLineOptions", LOG_CATEGORY)
}

/**
Expand Down Expand Up @@ -1021,6 +1023,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,11 @@ class MapboxRouteLineView @VisibleForTesting internal constructor(
Pair(MapboxRouteLineUtils.layerGroup3SourceKey, RouteLineFeatureId(null))
)

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

@TestOnly
internal fun initPrimaryRouteLineLayerGroup(layerIds: Set<String>) {
primaryRouteLineLayerGroup = layerIds
Expand Down Expand Up @@ -244,6 +250,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 +440,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 +474,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 +506,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
Original file line number Diff line number Diff line change
Expand Up @@ -137,39 +137,6 @@ class RouteLineColorResources private constructor(
.inActiveRouteLegsColor(inActiveRouteLegsColor)
}

/**
* Returns a string representation of the object.
*/
override fun toString(): String {
return "RouteLineColorResources(" +
"lowCongestionRange=$lowCongestionRange, " +
"heavyCongestionRange=$heavyCongestionRange, " +
"severeCongestionRange=$severeCongestionRange, " +
"moderateCongestionRange=$moderateCongestionRange, " +
"routeDefaultColor=$routeDefaultColor, " +
"routeLowCongestionColor=$routeLowCongestionColor, " +
"routeModerateCongestionColor=$routeModerateCongestionColor, " +
"routeHeavyCongestionColor=$routeHeavyCongestionColor, " +
"routeSevereCongestionColor=$routeSevereCongestionColor, " +
"routeUnknownCongestionColor=$routeUnknownCongestionColor, " +
"routeClosureColor=$routeClosureColor, " +
"restrictedRoadColor=$restrictedRoadColor, " +
"alternativeRouteDefaultColor=$alternativeRouteDefaultColor, " +
"alternativeRouteLowCongestionColor=$alternativeRouteLowCongestionColor, " +
"alternativeRouteModerateCongestionColor=$alternativeRouteModerateCongestionColor, " +
"alternativeRouteHeavyCongestionColor=$alternativeRouteHeavyCongestionColor, " +
"alternativeRouteSevereCongestionColor=$alternativeRouteSevereCongestionColor, " +
"alternativeRouteUnknownCongestionColor=$alternativeRouteUnknownCongestionColor, " +
"alternativeRouteRestrictedRoadColor=$alternativeRouteRestrictedRoadColor, " +
"alternativeRouteClosureColor=$alternativeRouteClosureColor, " +
"routeLineTraveledColor=$routeLineTraveledColor, " +
"routeLineTraveledCasingColor=$routeLineTraveledCasingColor, " +
"routeCasingColor=$routeCasingColor, " +
"alternativeRouteCasingColor=$alternativeRouteCasingColor, " +
"inActiveRouteLegsColor=$inActiveRouteLegsColor" +
")"
}

/**
* Returns a hash code value for the object.
*/
Expand Down Expand Up @@ -256,6 +223,36 @@ class RouteLineColorResources private constructor(
return true
}

override fun toString(): String {
return "RouteLineColorResources(" +
"lowCongestionRange=$lowCongestionRange, " +
"moderateCongestionRange=$moderateCongestionRange, " +
"heavyCongestionRange=$heavyCongestionRange, " +
"severeCongestionRange=$severeCongestionRange, " +
"routeDefaultColor=$routeDefaultColor, " +
"routeLowCongestionColor=$routeLowCongestionColor, " +
"routeModerateCongestionColor=$routeModerateCongestionColor, " +
"routeHeavyCongestionColor=$routeHeavyCongestionColor, " +
"routeSevereCongestionColor=$routeSevereCongestionColor, " +
"routeUnknownCongestionColor=$routeUnknownCongestionColor, " +
"alternativeRouteDefaultColor=$alternativeRouteDefaultColor, " +
"alternativeRouteLowCongestionColor=$alternativeRouteLowCongestionColor, " +
"alternativeRouteModerateCongestionColor=$alternativeRouteModerateCongestionColor, " +
"alternativeRouteHeavyCongestionColor=$alternativeRouteHeavyCongestionColor, " +
"alternativeRouteSevereCongestionColor=$alternativeRouteSevereCongestionColor, " +
"alternativeRouteUnknownCongestionColor=$alternativeRouteUnknownCongestionColor, " +
"restrictedRoadColor=$restrictedRoadColor, " +
"routeClosureColor=$routeClosureColor, " +
"alternativeRouteRestrictedRoadColor=$alternativeRouteRestrictedRoadColor, " +
"alternativeRouteClosureColor=$alternativeRouteClosureColor, " +
"routeLineTraveledColor=$routeLineTraveledColor, " +
"routeLineTraveledCasingColor=$routeLineTraveledCasingColor, " +
"routeCasingColor=$routeCasingColor, " +
"alternativeRouteCasingColor=$alternativeRouteCasingColor, " +
"inActiveRouteLegsColor=$inActiveRouteLegsColor" +
")"
}

/**
* A builder for instantiating the RouteLineResources class
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,38 +74,6 @@ class RouteLineResources private constructor(
.restrictedRoadLineWidth(restrictedRoadLineWidth)
}

/**
* Returns a string representation of the object.
*/
override fun toString(): String {
return "RouteLineResources(" +
"routeLineColorResources=$routeLineColorResources, " +
"roundedLineCap=$roundedLineCap, " +
"originWaypointIcon=$originWaypointIcon, " +
"destinationWaypointIcon=$destinationWaypointIcon, " +
"routeLineScaleExpression=$routeLineScaleExpression, " +
"routeCasingLineScaleExpression=$routeCasingLineScaleExpression, " +
"routeTrafficLineScaleExpression=$routeTrafficLineScaleExpression, " +
"trafficBackfillRoadClasses=$trafficBackfillRoadClasses, " +
"alternativeRouteLineScaleExpression=$alternativeRouteLineScaleExpression, " +
"alternativeRouteCasingLineScaleExpression=" +
"$alternativeRouteCasingLineScaleExpression, " +
"alternativeRouteTrafficLineScaleExpression=" +
"$alternativeRouteTrafficLineScaleExpression, " +
"routeLineColorResources=$routeLineColorResources, " +
"roundedLineCap=$roundedLineCap, " +
"originWaypointIcon=$originWaypointIcon, " +
"destinationWaypointIcon=$destinationWaypointIcon, " +
"routeLineScaleExpression=$routeLineScaleExpression, " +
"routeCasingLineScaleExpression=$routeCasingLineScaleExpression, " +
"routeTrafficLineScaleExpression=$routeTrafficLineScaleExpression, " +
"trafficBackfillRoadClasses=$trafficBackfillRoadClasses, " +
"restrictedRoadDashArray=$restrictedRoadDashArray, " +
"restrictedRoadOpacity=$restrictedRoadOpacity, " +
"restrictedRoadLineWidth=$restrictedRoadLineWidth" +
")"
}

/**
* Indicates whether some other object is "equal to" this one.
*/
Expand Down Expand Up @@ -166,6 +134,27 @@ class RouteLineResources private constructor(
return result
}

override fun toString(): String {
return "RouteLineResources(" +
"routeLineColorResources=$routeLineColorResources, " +
"roundedLineCap=$roundedLineCap, " +
"originWaypointIcon=$originWaypointIcon, " +
"destinationWaypointIcon=$destinationWaypointIcon, " +
"trafficBackfillRoadClasses=$trafficBackfillRoadClasses, " +
"routeLineScaleExpression=$routeLineScaleExpression, " +
"routeCasingLineScaleExpression=$routeCasingLineScaleExpression, " +
"routeTrafficLineScaleExpression=$routeTrafficLineScaleExpression, " +
"alternativeRouteLineScaleExpression=$alternativeRouteLineScaleExpression, " +
"alternativeRouteCasingLineScaleExpression=" +
"$alternativeRouteCasingLineScaleExpression, " +
"alternativeRouteTrafficLineScaleExpression=" +
"$alternativeRouteTrafficLineScaleExpression, " +
"restrictedRoadDashArray=$restrictedRoadDashArray, " +
"restrictedRoadOpacity=$restrictedRoadOpacity, " +
"restrictedRoadLineWidth=$restrictedRoadLineWidth" +
")"
}

/**
* A builder for instantiating the RouteLineResources class
*/
Expand Down

0 comments on commit 5927efb

Please sign in to comment.