Vehicle heading
This commit is contained in:
@@ -622,7 +622,7 @@ class NavigationSession : CarSession(), NavigationListener, NavigationObserverCa
|
||||
carContext,
|
||||
surfaceRenderer.lastLocation,
|
||||
listOf(destination),
|
||||
surfaceRenderer.carOrientation
|
||||
surfaceRenderer.cameraPosition.value!!.bearing.toFloat()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -21,11 +21,10 @@ const val tomtomTrafficUrl = "https://api.tomtom.com/traffic/services/5/incident
|
||||
private const val tomtomFields =
|
||||
"{incidents{type,geometry{type,coordinates},properties{iconCategory,events{description}}}}"
|
||||
|
||||
val useLocal = BuildConfig.DEBUG
|
||||
val useLocal = false // BuildConfig.DEBUG
|
||||
|
||||
val useLocalTraffic = BuildConfig.DEBUG
|
||||
|
||||
|
||||
class TomTomRepository : NavigationRepository() {
|
||||
override fun getRoute(
|
||||
context: Context,
|
||||
@@ -34,6 +33,11 @@ class TomTomRepository : NavigationRepository() {
|
||||
carOrientation: Float,
|
||||
searchFilter: SearchFilter
|
||||
): String {
|
||||
val vehicleHeading = if (carOrientation !in 0.0..360.0) {
|
||||
0
|
||||
} else {
|
||||
carOrientation.toInt()
|
||||
}
|
||||
if (useLocal) {
|
||||
return fetchUrl(
|
||||
"https://kouros-online.de/tomtom_routing.json",
|
||||
@@ -83,7 +87,7 @@ class TomTomRepository : NavigationRepository() {
|
||||
"&vehicleMaxSpeed=120&vehicleCommercial=false" +
|
||||
"&instructionsType=text&language=$language§ionType=lanes" +
|
||||
"&routeRepresentation=encodedPolyline$altRoutes" +
|
||||
"&vehicleEngineType=$engineType$filter&key=$tomtomApiKey"
|
||||
"&vehicleHeading=$vehicleHeading&vehicleEngineType=$engineType$filter&key=$tomtomApiKey"
|
||||
return fetchUrl(
|
||||
url,
|
||||
false
|
||||
|
||||
Reference in New Issue
Block a user