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

Maximum URL size #138

Open
PedroFabrino opened this issue Feb 14, 2017 · 4 comments
Open

Maximum URL size #138

PedroFabrino opened this issue Feb 14, 2017 · 4 comments

Comments

@PedroFabrino
Copy link

According to Google's documentation for Static Map, the max size for url is 8192 characters, https://developers.google.com/maps/documentation/static-maps/intro#url-size-restriction.

But, when building an static map with gm.staticMap(params),
I get the following error:
Error: Request too long for google to handle (2048 characters).
at module.exports (.../node_modules/googlemaps/lib/utils/makeRequest.js:63:13)
at module.exports [as staticMap] (.../node_modules/googlemaps/lib/staticMap.js:116:10)

It's thrown an error before making a request for google, so it's internal.

Could it be fixed? Or should I make a fork for doing so? Or is there a reason as not working?

@ClaaziX
Copy link

ClaaziX commented Jun 30, 2017

if there are only 2045 chars and the lmit is 8192... why is it throwing this error at all?

@PedroFabrino
Copy link
Author

Because the error is being thrown by the node-googlemaps, and not by google itself.

@jitendra-kr
Copy link

Yes i am facing same problem. I created an issue also for the same.

@twindual
Copy link

In the /lib/requests/contants.json file it has the max values listed as 2048.

We could up that to 8192 and solve the issue.

"MAX_REQUEST_LENGTHS": {
"directions": 2048,
"distance-matrix": 2048,
"elevation": -1,
"geocode": 2048,
"place-details": 2048,
"place-search-nearby": 2048,
"place-search-text": 2048,
"place-autocomplete": 2048,
"reverse-geocode": 2048,
"static-map": 2048,
"timezone": 2048,
"street-view": 2048
},

twindual pushed a commit to twindual/node-googlemaps that referenced this issue Apr 15, 2020
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

4 participants