google-maps-static-api

Real Google static map URL limit


One of the features on my site is a landing page that uses static maps to show a route created by the user. I noted some time ago that some routes would break, and presumed that this was due to very long routes exceeding the 2048 character limit. It's a pretty simple fix; I make the routes shorter by pulling out every other point (as many times as it takes to get the URL short enough.) Since these are very long routes and relatively small images, the loss of precision isn't really noticeable.

Here's the thing though. I went back to find some older very long routes to test with before deploying, and I couldn't find any that were broken. I'm finding routes with URLs over 6000 characters that are working just fine: http://gmap-pedometer.com/gp/bookmark/view/id/6829704.

In fact, I can't find any routes that are breaking. There must have been a change on the API side. The documentation still says the URL limit is 2048. Does anyone know what the new limit is?


Solution

  • The documentation is already updated:

    Google Static Maps API URLs are restricted to 8192 characters in size.