node-googlemaps icon indicating copy to clipboard operation
node-googlemaps copied to clipboard

fixed multiple paths

Open CharlyGeen opened this issue 7 years ago • 1 comments

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=

CharlyGeen avatar Nov 04 '17 15:11 CharlyGeen

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

markshapiro avatar Jan 23 '18 13:01 markshapiro