Skip to content

feat(navigation): Implement place search along route and example #684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dkhawk
Copy link
Collaborator

@dkhawk dkhawk commented Mar 5, 2025

Adds functionality to search for places along the navigation route.

  • Introduces placesAlongRoute and routeReady StateFlows in MainActivity and NavigationViewModel to manage search results and route status.
  • Passes these states and onClearSearchResults, onSearchClicked lambdas to NavigationScreen.
  • Implements UI in NavigationScreen to:
    • Display search results in a card below the map.
    • Allow clearing search results via a close button.
    • Provide example search buttons ("Spicy Veg", "Pizza") when the route is ready.
  • Implements searchAlongRoute function in NavigationViewModel to use the Places API searchAlongRoute functionality to fetch places.
  • Implements clearSearchResults function in NavigationViewModel to clear the search results state.
  • Adds a route changed listener in NavigationViewModel to set routeReady to true when a navigation route is established.
  • Adds SearchAlongRouteExample.kt as an example class demonstrating how to use the NavigatorListener and perform place search along the route when a route is established. This class serves as a demonstration and potential helper for integrating the search functionality.

Thank you for opening a Pull Request!

Adds functionality to search for places along the navigation route.

- Introduces `placesAlongRoute` and `routeReady` StateFlows in `MainActivity` and `NavigationViewModel` to manage search results and route status.
- Passes these states and `onClearSearchResults`, `onSearchClicked` lambdas to `NavigationScreen`.
- Implements UI in `NavigationScreen` to:
    - Display search results in a card below the map.
    - Allow clearing search results via a close button.
    - Provide example search buttons ("Spicy Veg", "Pizza") when the route is ready.
- Implements `searchAlongRoute` function in `NavigationViewModel` to use the Places API searchAlongRoute functionality to fetch places.
- Implements `clearSearchResults` function in `NavigationViewModel` to clear the search results state.
- Adds a route changed listener in `NavigationViewModel` to set `routeReady` to true when a navigation route is established.
- Adds `SearchAlongRouteExample.kt` as an example class demonstrating how to use the `NavigatorListener` and perform place search along the route when a route is established. This class serves as a demonstration and potential helper for integrating the search functionality.
@dkhawk dkhawk marked this pull request as draft March 5, 2025 00:22
@googlemaps-bot
Copy link
Contributor

Code Coverage

There is no coverage information present for the Files changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants