Skip to content

Commit 8041ec6

Browse files
committed
NAVAND-1166: add snapshot logs
1 parent d811f31 commit 8041ec6

File tree

6 files changed

+29
-2
lines changed

6 files changed

+29
-2
lines changed

.circleci/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ workflows:
3838
only:
3939
- main
4040
- release-v.*
41+
- NAVAND-1166-dd-logs
4142
- release:
4243
filters:
4344
tags:

gradle/artifact-settings.gradle

+1-1
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.7.2-logged-SNAPSHOT'
1616
}
1717

1818
def getVersionName() {

libnavui-maps/build.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ dependencies {
4343
implementation project(":libnavui-resources")
4444

4545
api dependenciesList.mapboxMapSdk
46+
api("com.mapbox.maps:android-core") {
47+
version {
48+
strictly '10.7.0-a34a63fde5-SNAPSHOT'
49+
}
50+
}
4651
api dependenciesList.mapboxSdkTurf
4752

4853
implementation dependenciesList.androidXAppCompat
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package com.mapbox.navigation.ui.maps.camera
2+
3+
internal object LogTag {
4+
5+
const val TAG = "[maps-core-sdk]"
6+
}

libnavui-maps/src/main/java/com/mapbox/navigation/ui/maps/camera/data/MapboxNavigationViewportDataSource.kt

+11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.mapbox.navigation.ui.maps.camera.data
22

33
import android.location.Location
4+
import android.util.Log
45
import androidx.annotation.UiThread
56
import com.mapbox.api.directions.v5.models.DirectionsRoute
67
import com.mapbox.api.directions.v5.models.LegStep
@@ -16,6 +17,7 @@ import com.mapbox.navigation.base.route.NavigationRoute
1617
import com.mapbox.navigation.base.route.toNavigationRoute
1718
import com.mapbox.navigation.base.trip.model.RouteProgress
1819
import com.mapbox.navigation.core.MapboxNavigation
20+
import com.mapbox.navigation.ui.maps.camera.LogTag
1921
import com.mapbox.navigation.ui.maps.camera.NavigationCamera
2022
import com.mapbox.navigation.ui.maps.camera.data.ViewportDataSourceProcessor.getMapAnchoredPaddingFromUserPadding
2123
import com.mapbox.navigation.ui.maps.camera.data.ViewportDataSourceProcessor.getPitchFallbackFromRouteProgress
@@ -558,6 +560,7 @@ class MapboxNavigationViewportDataSource(
558560
* Provide additional points that should be fitted into the following frame update.
559561
*/
560562
fun additionalPointsToFrameForFollowing(points: List<Point>) {
563+
Log.i(LogTag.TAG, "additionalPointsToFrameForFollowing: $points")
561564
additionalPointsToFrameForFollowing = ArrayList(points)
562565
}
563566

@@ -577,6 +580,7 @@ class MapboxNavigationViewportDataSource(
577580
* @see [evaluate]
578581
*/
579582
fun followingCenterPropertyOverride(value: Point?) {
583+
Log.i(LogTag.TAG, "followingCenterPropertyOverride: $value")
580584
followingCenterProperty.override = value
581585
}
582586

@@ -589,6 +593,7 @@ class MapboxNavigationViewportDataSource(
589593
* @see [evaluate]
590594
*/
591595
fun followingZoomPropertyOverride(value: Double?) {
596+
Log.i(LogTag.TAG, "followingZoomPropertyOverride: $value")
592597
followingZoomProperty.override = value
593598
}
594599

@@ -601,6 +606,7 @@ class MapboxNavigationViewportDataSource(
601606
* @see [evaluate]
602607
*/
603608
fun followingBearingPropertyOverride(value: Double?) {
609+
Log.i(LogTag.TAG, "followingBearingPropertyOverride: $value")
604610
followingBearingProperty.override = value
605611
}
606612

@@ -613,6 +619,7 @@ class MapboxNavigationViewportDataSource(
613619
* @see [evaluate]
614620
*/
615621
fun followingPitchPropertyOverride(value: Double?) {
622+
Log.i(LogTag.TAG, "followingPitchPropertyOverride: $value")
616623
followingPitchProperty.override = value
617624
}
618625

@@ -699,6 +706,8 @@ class MapboxNavigationViewportDataSource(
699706
// needs to be added here to be taken into account for bearing smoothing
700707
pointsForFollowing.addAll(additionalPointsToFrameForFollowing)
701708

709+
Log.i(LogTag.TAG, "Target location: $localTargetLocation, pointsToFrame: $pointsForFollowing")
710+
702711
if (pointsForFollowing.isEmpty()) {
703712
options.followingFrameOptions.run {
704713
val cameraState = mapboxMap.cameraState
@@ -734,6 +743,7 @@ class MapboxNavigationViewportDataSource(
734743
options.followingFrameOptions.maximizeViewableGeometryWhenPitchZero &&
735744
followingPitchProperty.get() == ZERO_PITCH
736745
) {
746+
Log.i(LogTag.TAG, "maximizeViewableGeometryWhenPitchZero=true, \npoints to frame: $pointsForFollowing, \npadding: $followingPadding")
737747
mapboxMap.cameraForCoordinates(
738748
pointsForFollowing,
739749
followingPadding,
@@ -758,6 +768,7 @@ class MapboxNavigationViewportDataSource(
758768
.pitch(followingPitchProperty.get())
759769
.zoom(cameraState.zoom)
760770
.build()
771+
Log.i(LogTag.TAG, "maximizeViewableGeometryWhenPitchZero=false, \npoints to frame: $pointsForFollowing, \ncamera center: ${fallbackCameraOptions.center}\nmap size: $mapSize, followingPadding=${followingPadding}, screenBox=$screenBox, resultingPadding=$padding, zoom=${fallbackCameraOptions.zoom}")
761772
if (pointsForFollowing.size > 1) {
762773
mapboxMap.cameraForCoordinates(
763774
pointsForFollowing,

libnavui-maps/src/main/java/com/mapbox/navigation/ui/maps/camera/data/ViewportDataSourceProcessor.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.mapbox.navigation.ui.maps.camera.data
22

3+
import android.util.Log
34
import com.mapbox.api.directions.v5.models.DirectionsRoute
45
import com.mapbox.geojson.LineString
56
import com.mapbox.geojson.Point
@@ -11,6 +12,7 @@ import com.mapbox.navigation.base.trip.model.RouteLegProgress
1112
import com.mapbox.navigation.base.trip.model.RouteProgress
1213
import com.mapbox.navigation.base.trip.model.RouteStepProgress
1314
import com.mapbox.navigation.base.utils.DecodeUtils.stepsGeometryToPoints
15+
import com.mapbox.navigation.ui.maps.camera.LogTag
1416
import com.mapbox.navigation.utils.internal.logE
1517
import com.mapbox.turf.TurfConstants
1618
import com.mapbox.turf.TurfException
@@ -250,14 +252,16 @@ internal object ViewportDataSourceProcessor {
250252
}
251253

252254
return followingFrameOptions.pitchNearManeuvers.run {
253-
if (
255+
(if (
254256
enabled &&
255257
upcomingManeuverType !in excludedManeuvers &&
256258
currentStepProgress.distanceRemaining <= triggerDistanceFromManeuver
257259
) {
258260
MapboxNavigationViewportDataSource.ZERO_PITCH
259261
} else {
260262
followingFrameOptions.defaultPitch
263+
}).also {
264+
Log.i(LogTag.TAG, "getPitchFallbackFromRouteProgress, result=$it, default pitch=${followingFrameOptions.defaultPitch}, distanceRemaining=${currentStepProgress.distanceRemaining}, triggerDistanceFromManeuver=$triggerDistanceFromManeuver")
261265
}
262266
}
263267
}

0 commit comments

Comments
 (0)