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