diff --git a/gradle/artifact-settings.gradle b/gradle/artifact-settings.gradle index 8789b3e35dd..a68a4c19438 100644 --- a/gradle/artifact-settings.gradle +++ b/gradle/artifact-settings.gradle @@ -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() { diff --git a/libnavui-maps/src/main/java/com/mapbox/navigation/ui/maps/route/line/api/MapboxRouteLineApi.kt b/libnavui-maps/src/main/java/com/mapbox/navigation/ui/maps/route/line/api/MapboxRouteLineApi.kt index 5ba3d9f6fef..6ce44460c55 100644 --- a/libnavui-maps/src/main/java/com/mapbox/navigation/ui/maps/route/line/api/MapboxRouteLineApi.kt +++ b/libnavui-maps/src/main/java/com/mapbox/navigation/ui/maps/route/line/api/MapboxRouteLineApi.kt @@ -255,6 +255,8 @@ class MapboxRouteLineApi( trafficBackfillRoadClasses.addAll( routeLineOptions.resourceProvider.trafficBackfillRoadClasses ) + logI("BelowLayerId: ${routeLineOptions.routeLineBelowLayerId}", LOG_CATEGORY) + logI("All options: $routeLineOptions", LOG_CATEGORY) } /** @@ -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 }, diff --git a/libnavui-maps/src/main/java/com/mapbox/navigation/ui/maps/route/line/api/MapboxRouteLineView.kt b/libnavui-maps/src/main/java/com/mapbox/navigation/ui/maps/route/line/api/MapboxRouteLineView.kt index 5ca0013177c..0f6cff51eb4 100644 --- a/libnavui-maps/src/main/java/com/mapbox/navigation/ui/maps/route/line/api/MapboxRouteLineView.kt +++ b/libnavui-maps/src/main/java/com/mapbox/navigation/ui/maps/route/line/api/MapboxRouteLineView.kt @@ -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 /** @@ -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) { primaryRouteLineLayerGroup = layerIds @@ -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) @@ -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( @@ -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) @@ -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) + } } } } diff --git a/libnavui-maps/src/main/java/com/mapbox/navigation/ui/maps/route/line/model/RouteLineColorResources.kt b/libnavui-maps/src/main/java/com/mapbox/navigation/ui/maps/route/line/model/RouteLineColorResources.kt index 2bd3e6ac63a..0ef812b8331 100644 --- a/libnavui-maps/src/main/java/com/mapbox/navigation/ui/maps/route/line/model/RouteLineColorResources.kt +++ b/libnavui-maps/src/main/java/com/mapbox/navigation/ui/maps/route/line/model/RouteLineColorResources.kt @@ -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. */ @@ -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 */ diff --git a/libnavui-maps/src/main/java/com/mapbox/navigation/ui/maps/route/line/model/RouteLineResources.kt b/libnavui-maps/src/main/java/com/mapbox/navigation/ui/maps/route/line/model/RouteLineResources.kt index 431e6d1bee9..eb9f8b7737d 100644 --- a/libnavui-maps/src/main/java/com/mapbox/navigation/ui/maps/route/line/model/RouteLineResources.kt +++ b/libnavui-maps/src/main/java/com/mapbox/navigation/ui/maps/route/line/model/RouteLineResources.kt @@ -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. */ @@ -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 */