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

Direction Component with waypoints #77

Open
CScott0905 opened this issue Jul 8, 2020 · 3 comments
Open

Direction Component with waypoints #77

CScott0905 opened this issue Jul 8, 2020 · 3 comments

Comments

@CScott0905
Copy link

I'm trying to utilise the Direction component to render a static image that goes from A -> D via B & C I can see the directions API supports this via the waypoints param but when i pass this to the direction component nothing happens is there a way to get this functionality currently with the Direction component?

Unfortunately i do need the route rather than path so using the path component to handle this is not sufficient

@DaddyWarbucks
Copy link
Collaborator

I can see in this line

that we do take in waypoints from props and pass it to the strategy.

But on this line in the strategy, you can see that we are not using the waypoints (or many other props)

const { origin, destination, travelMode } = data;

Both the nativeStrategy and the fetchStrategy should be updated to handle all of the directions props/options passed to them, unless @bondz has a reason they were not initially implemented. I believe he mentioned that the Directions component was added on later and kind of an "after thought", so its likely they weren't implemented simply for that reason.

I am travelling for the next two weeks. But when I get home I should be able to take a look at this.

@CScott0905 you can currently accomplish this by passing a promise to requestStrategy. Take a look at this line:

pathPromise = requestStrategy(data);

You can then take a look at the native and fetch strategies and see that they are basic calls to the google directions API and you can create your own.

@bondz
Copy link
Owner

bondz commented Jul 9, 2020

Yes @DaddyWarbucks, it was an oversight. The directions component was a POC to prove that you could render directions async to a path and because the user could implement their own strategy to get the directions, the implementation was not prioritized. Wishing you safe travels @DaddyWarbucks

A workaround is to implement your own strategy @CScott0905 like @DaddyWarbucks showed until all the other props for Directions are handled by the built in strategies.

@CScott0905
Copy link
Author

@DaddyWarbucks @bondz thank you for the quick response I will try the above thank you.

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

No branches or pull requests

3 participants