Skip to content
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

Create params for skipGo and accessibility #381

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

matbmapspeople
Copy link
Contributor

What:

  • Introducing new skipGo URL param - when present in the URL, the route should appear straightway without a need to click 'Go' button
  • Introducing new accessibility URL param - when present in the URL, accessibility should be taken into consideration when getting a route

How:

  • Introducing webcomponent.js, queryParameter and setters for both: skipGo and accessibility.
  • If condition for accessibility is true, then we assign checked to true.
  • If condition for skipGo is true, then we call onStartDirections function which normally is called when we click 'Go' button.
  • I created isFinishRouteState atom, so when we click 'Finish Route', we are not ending up in infinite loop of rendering the route.

Working solution:

Uploading Screen Recording 2024-06-20 at 11.22.55.mov…

@matbmapspeople
Copy link
Contributor Author

I will take care of read me and changelog later. I want to make sure that logic is correct @andreeaceachir142

}
}
}, [skipGo, isSet, directionsFromLocation, directionsToLocation, isDirectionReady])

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some docs on what is happening here

if (originLocation?.geometry && destinationLocation?.geometry) {
directionsService.getRoute({
origin: getLocationPoint(originLocation),
destination: getLocationPoint(destinationLocation),
travelMode: travelMode,
avoidStairs: accessibilityOn
avoidStairs: accessibilityOn || accessibility[0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use recoil value instead

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