googlemaps-samples / googlemaps-samples/android-navigation-samples

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

Open
#17 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
16
Forks
16
PR merge metrics
No merged PRs in 30d

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

  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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the navigateToPlace() entry point and inspect the Waypoint, DisplayOptions, RoutingOptions, and navigator.setDestinations() usage shown in the issue. Verify how waypoint markers and multi-waypoint guidance are represented, then confirm that all requested segments remain active while navigation retains turn, road-name, time, and distance information. Done means the waypoint circles are absent and the complete route behaves as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.