How to use Google Static Map Path API for showing a path containing more than 1000 lat-longs points? I tried encoding the latlong using PolyUtils.encode() but still the the final url formed using encoded string exceeds the url length limit of 2048.
11
-
I have the same issue like yours. I think you can not draw real path with static map API. Yes I succeed in displaying path but it is just a straight line nothing more.Hitesh Kamani– Hitesh Kamani2015-08-13 06:14:43 +00:00Commented Aug 13, 2015 at 6:14
-
I think that's limitation when use Google Map with free.Neo– Neo2015-08-13 06:22:55 +00:00Commented Aug 13, 2015 at 6:22
-
@MrNeo So, do they provide different API for paid?dheeraj sharma– dheeraj sharma2015-08-13 06:54:01 +00:00Commented Aug 13, 2015 at 6:54
-
you could access here and click Get in touch to contact them for more information.Neo– Neo2015-08-13 07:03:18 +00:00Commented Aug 13, 2015 at 7:03
-
@MrNeo Yeah I just did. Thanks!!dheeraj sharma– dheeraj sharma2015-08-13 07:24:25 +00:00Commented Aug 13, 2015 at 7:24
|
Show 6 more comments
2 Answers
Short answer: you can't pass more than 2048 characters. It's not possible to do it with the Google Static Maps API.
On the other hand, you could use the JavaScript API and take a snapshot with html2canvas.js.
See the example I provided in this other post: https://stackoverflow.com/a/37750987/4537906
Comments
Recently, the URL length limit was changed to 8192 characters as the response of feature request in public issue tracker.
https://developers.google.com/maps/documentation/static-maps/intro#url-size-restriction