Fuel, Snap initial location
This commit is contained in:
@@ -273,6 +273,10 @@ class NavigationSession : CarSession(), NavigationListener, NavigationObserverCa
|
||||
routeModel = RouteCarModel()
|
||||
|
||||
CarConnection(carContext).type.observe(this, ::onConnectionStateUpdated)
|
||||
|
||||
navigationViewModel.initialSnapLocation.observe(this, Observer {
|
||||
surfaceRenderer.updateLocation(it, "")
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -315,6 +319,7 @@ class NavigationSession : CarSession(), NavigationListener, NavigationObserverCa
|
||||
shouldUseCarLocationFlow = carSensorManager.shouldUseCarLocation(),
|
||||
onLocationUpdate = ::updateLocation,
|
||||
onInitialLocation = { location ->
|
||||
navigationViewModel.loadCurrentLocation(location)
|
||||
navigationViewModel.loadRecentPlaces(
|
||||
carContext,
|
||||
location,
|
||||
@@ -753,12 +758,6 @@ class NavigationSession : CarSession(), NavigationListener, NavigationObserverCa
|
||||
lastTrafficDate = current
|
||||
navigationViewModel.loadTraffic(carContext, location, surfaceRenderer.carOrientation)
|
||||
}
|
||||
if (updateLocationIndex % 4 == 0) {
|
||||
// navigationViewModel.updateTrafficMessages(
|
||||
// surfaceRenderer.lastLocation,
|
||||
// surfaceRenderer.trafficData.value!!
|
||||
// )
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user