Skip to content

Conversation

@CharlyGeen
Copy link

When parsing the path array each next path must be transformed to &path=
The first path is transformed correctly but each next path is not.
Removing the .join('|') will fix this bug.

See https://developers.google.com/maps/documentation/static-maps/intro#URL_Parameters
-> Feature Parameters -> path:

"path (optional) defines a single path of two or more connected points to overlay on the image at specified locations. This parameter takes a string of point definitions separated by the pipe character (|). You may supply additional paths by adding additional path parameters. Note that if you supply a path for a map, you do not need to specify the (normally required) center and zoom parameters. For more information, see Google Static Maps API Paths below."

-> "You may supply additional paths by adding additional path parameters." and so each URL parameter "path" has the following format:

&path=

When parsing the path array each next path must be transformed to &path=
The first path is transformed correctly but each next path is not.
Removing the .join('|') will fix this bug.

See https://developers.google.com/maps/documentation/static-maps/intro#URL_Parameters
-> Feature Parameters -> path:

"path (optional) defines a single path of two or more connected points to overlay on the image at specified locations. This parameter takes a string of point definitions separated by the pipe character (|). You may supply additional paths by adding additional path parameters. Note that if you supply a path for a map, you do not need to specify the (normally required) center and zoom parameters. For more information, see Google Static Maps API Paths below."

-> "You may supply additional paths by adding additional path parameters." and so each URL parameter "path" has the following format:

 &path=
@markshapiro
Copy link

markshapiro commented Jan 23, 2018

the unit test for parsePathsTest is failing,
fixable buy defining array instead of concatenated string as expected result
https://github.com/moshen/node-googlemaps/blob/master/test/unit/utils/parsePathsTest.js#L66

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