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

Problem with buildUrl function and waypoints #49

Open
leandroz opened this issue Jul 23, 2014 · 4 comments
Open

Problem with buildUrl function and waypoints #49

leandroz opened this issue Jul 23, 2014 · 4 comments

Comments

@leandroz
Copy link

The buildUrl function is not working well when the direction service is called with the waypoints parameter, the path after calling 'path = buildUrl(path, args)' is like this:

/maps/api/directions/json?origin=Vuelta%20de%20Haedo%20-%20Avenida%20Rivadavia%2C%20Haedo%2C%20Buenos%20Aires%2C%20Argentina&destination=Vuelta%20de%20Haedo%20-%20Avenida%20Rivadavia%2C%20Haedo%2C%20Buenos%20Aires%2C%20Argentina&waypoints=&waypoints=&language=es&sensor=false

@leandroz
Copy link
Author

I dig more and the problem is with querystring.stringify(). This is the google maps url example with waypoints:
origin=Boston,MA&destination=Concord,MA&waypoints=Charlestown,MA|Lexington,MA&sensor=false
And this is what querystring.stringify() return:
origin=Boston,MA&destination=Concord,MA&waypoints=&waypoints=&sensor=false

@leandroz
Copy link
Author

leandroz commented Oct 7, 2014

I saw the new version file and has the same problem, anyone?

@fabriziomoscon
Copy link
Collaborator

@leandroz I am working on a new branch where I tried to add a simple sanity check (not completed) that checks what happens passing waypoints to makeRequest
affb7d1

this is the uri which is going to be used by request:
http://maps.googleapis.com/maps/api/directions/json?origin=Boston%2C%20MA%2C%20USA&destination=Concord%2C%20MA%2C%20USA&mode=driving&waypoints=Charlestown%2CMA%7CLexington%2CMA&sensor=false

There is nothing bad with that URI as HTTP encoding is a standard well understood by web servers.

The sanity check passes in the branch. Please feel free to extend that check to make it fail.

@fabriziomoscon
Copy link
Collaborator

@leandroz The v1.0.0 of the library is published on npm and merged into master, feel free to check if this is still an issue and update this page

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

2 participants