Problem with buildUrl function and waypoints
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
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
I saw the new version file and has the same problem, anyone?
@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
https://github.com/moshen/node-googlemaps/commit/affb7d1b950b54c5e22798dfb073dc78b0a5706d
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.
@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