Preview
This commit is contained in:
@@ -130,9 +130,8 @@ object Constants {
|
||||
|
||||
const val TRAFFIC_UPDATE = 300
|
||||
|
||||
const val ROUTE_UPDATE = 60
|
||||
|
||||
const val INSTRUCTION_DISTANCE = 50
|
||||
|
||||
const val GMS_CAR_SPEED_PERMISSION = "com.google.android.gms.permission.CAR_SPEED"
|
||||
|
||||
const val AUTOMOTIVE_CAR_SPEED_PERMISSION = "android.car.permission.CAR_SPEED"
|
||||
|
||||
@@ -105,15 +105,6 @@ data class Route(
|
||||
}
|
||||
}
|
||||
|
||||
fun nextStep(add: Int): Step {
|
||||
val nextIndex = currentStepIndex + add
|
||||
return if (isRouteValid() && nextIndex < legs().first().steps.size) {
|
||||
legs().first().steps[nextIndex]
|
||||
} else {
|
||||
currentStep()
|
||||
}
|
||||
}
|
||||
|
||||
fun maneuverLocations(): List<Point> {
|
||||
val waypoints = currentStep().maneuver.waypoints
|
||||
val points = mutableListOf<Point>()
|
||||
@@ -123,4 +114,13 @@ data class Route(
|
||||
}
|
||||
return points
|
||||
}
|
||||
|
||||
fun nextStep(add: Int): Step {
|
||||
val nextIndex = currentStepIndex + add
|
||||
return if (isRouteValid() && nextIndex < legs().first().steps.size) {
|
||||
legs().first().steps[nextIndex]
|
||||
} else {
|
||||
currentStep()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,9 +19,9 @@ const val tomtomTrafficUrl = "https://api.tomtom.com/traffic/services/5/incident
|
||||
private const val tomtomFields =
|
||||
"{incidents{type,geometry{type,coordinates},properties{iconCategory,events{description}}}}"
|
||||
|
||||
const val useLocal = false
|
||||
const val useLocal = true
|
||||
|
||||
const val useLocalTraffic = false
|
||||
const val useLocalTraffic = true
|
||||
|
||||
|
||||
class TomTomRepository : NavigationRepository() {
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context
|
||||
import android.location.Location
|
||||
import android.location.LocationManager
|
||||
import androidx.car.app.model.Distance
|
||||
import com.kouros.navigation.data.Constants.TILT
|
||||
import com.kouros.navigation.data.RouteEngine
|
||||
import com.kouros.navigation.data.osrm.OsrmRepository
|
||||
import com.kouros.navigation.data.tomtom.TomTomRepository
|
||||
@@ -93,7 +94,7 @@ fun calculateTilt(newZoom: Double, tilt: Double): Double =
|
||||
0.0
|
||||
} else {
|
||||
if (tilt == 0.0) {
|
||||
55.0
|
||||
TILT
|
||||
} else {
|
||||
tilt
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user