Skip to content

How to remove stopover icons and When user reach point A to point B then point B to point C route is not active. #17

@AppristineMahesh

Description

@AppristineMahesh

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

  1. Hide or Remove waypoints circles. Don't want to show markers as well.
  2. 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.

Screenshot_20241121-132221

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions