-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Changed the navigatePlace() code as following
`
private fun navigateToPlace() {
val sdkWaypoints = mutableListOf<Waypoint>()
val sdkWaypoint1 = Waypoint.builder()
.setLatLng(18.593743123889453, 73.7864201905899)
.setVehicleStopover(false) // Set stopover for start and end points only
.build()
val sdkWaypoint2 = Waypoint.builder()
.setLatLng(18.596919333460644, 73.79149754042395)
.setVehicleStopover(false) // Set stopover for start and end points only
.build()
val sdkWaypoint3 = Waypoint.builder()
.setLatLng(18.598636297753263, 73.79769591147753)
.setVehicleStopover(false) // Set stopover for start and end points only
.build()
val sdkWaypoint4 = Waypoint.builder()
.setLatLng(18.599638673204023, 73.79286069709781)
.setVehicleStopover(false) // Set stopover for start and end points only
.build()
val sdkWaypoint5 = Waypoint.builder()
.setLatLng(18.594532659365417, 73.78771127333108)
.setVehicleStopover(false) // Set stopover for start and end points only
.build()
sdkWaypoints.add(sdkWaypoint1)
sdkWaypoints.add(sdkWaypoint2)
sdkWaypoints.add(sdkWaypoint3)
sdkWaypoints.add(sdkWaypoint4)
sdkWaypoints.add(sdkWaypoint5)
withNavigatorAsync {
val displayOptions = DisplayOptions()
displayOptions.showStopSigns(true)
displayOptions.showTrafficLights(true)
displayOptions.hideDestinationMarkers(false)
val mRoutingOptions = RoutingOptions()
mRoutingOptions.travelMode(RoutingOptions.TravelMode.DRIVING)
val pendingRoute = navigator.setDestinations(sdkWaypoints, mRoutingOptions, displayOptions);
// Set an action to perform when a route is determined to the destination
pendingRoute.setOnResultListener { code ->
when (code) {
RouteStatus.OK -> {
// Hide the toolbar to maximize the navigation UI
actionBar?.hide()
// Enable voice audio guidance (through the device speaker)
navigator.setAudioGuidance(Navigator.AudioGuidance.VOICE_ALERTS_AND_GUIDANCE)
// Simulate vehicle progress along the route (for demo/debug builds)
if (BuildConfig.DEBUG) {
navigator.simulator.simulateLocationsAlongExistingRoute(
SimulationOptions().speedMultiplier(5f)
)
}
// Start turn-by-turn guidance along the current route
navigator.startGuidance()
}
RouteStatus.ROUTE_CANCELED -> {
// Return to top-down perspective
showToast("Route guidance cancelled.")
}
RouteStatus.NO_ROUTE_FOUND,
RouteStatus.NETWORK_ERROR -> {
// TODO: Add logic to handle when a route could not be determined
showToast("Error starting guidance: $code")
}
else -> showToast("Error starting guidance: $code")
}
}
}
}
`
Now map is showing all points connected. which is correct but i need to do it 2 things
- Hide or Remove waypoints circles. Don't want to show markers as well.
- Now map is navigating me to first point 1 which is active path but i want active path to be from start point to point 1, 2, 3 4 and 5 all will be active path.
Please check attached screenshot. I want to show like this and also the navigation features like turns, road name, remaining time to reach destination, meter remaining.
Metadata
Metadata
Assignees
Labels
No labels