snapdev
snapdev

Reputation: 133

Is there a size limit for an encoded path to the google static map API?

I've got an application that draws a map using a set of LatLng points to create a polyline. I want to generate a static map of this path using the Google Static Map API and passed the result of the polyline's getPath() method to google.maps.geometry.encoding.encodePath to generate the encoded path. When I pass this to: https://maps.googleapis.com/maps/api/staticmap?size=400x400&path=weight:3%7Ccolor:orange%7Cenc:polyline_data where "polyline_data" represents the encoded line I get a status of "400 (Bad Request)"

When I cut the number of points down so I only pass in every 20th point the encoded path renders a static map correctly. My polyline is comprised of about 6000 points and when cut down to about 300 it renders cleanly.

I understand the resolution of the points I started with is to fine grained but have not been able to find what the actual limit is for the number of LatLng points passed to the encodePath method such that this encoded string can be passed to the google static map API. Can someone help point me at the specified limits? Thank you.

Upvotes: 3

Views: 1558

Answers (1)

geocodezip
geocodezip

Reputation: 161384

From the Web Services Documentation

Additionally, URLs are limited to 8192 characters for all web services. For most services, this character limit will seldom be approached. However, note that certain services have several parameters that may result in long URLs.

Upvotes: 4

Related Questions