Ok, maybe this is a stupid question but i spend hours and didn't find something to help me to discover this. I'm using Google Maps Static Map to draw a map with many points in path, i'm doing one request like this one:
https://maps.googleapis.com/maps/api/staticmap?size=1000x500&maptype=roadmap&markers=icon:http://api.appcargo.com/app_images/ic_pin.png|44.80006858,20.4791788&markers=icon:http://api.appcargo.com/app_images/ic_pin_destination_toolbar.png|44.8013566,20.4804733&path=color:0xff0000ff|weight:5|44.80006858,20.4791788|44.80028333,20.47892833|44.80152833,20.48004833|44.80135667,20.48047333&format=jpg
Works fine! Now i'm trying to use Polylines to create a short request because google api limit is 2000 characters and for my app i have situations with more than 100 coordinates points to put in path. I have the algorithm(PHP) to encode the coordinates in Polylines,after this i request again with the coordinates encoded. The result for same request but with Polyline:
https://maps.googleapis.com/maps/api/staticmap?size=1000x500&maptype=roadmap&markers=icon:http://api.appcargo.com/app_images/ic_pin.png|44.80006858,20.4791788&markers=icon:http://api.appcargo.com/app_images/ic_pin_destination_toolbar.png|44.8013566,20.4804733&path=color:0xff0000ff|weight:5|m_mpG{y~{Bi@p@yF_F`@sA&format=jpg
Don't work...so my question here is: Can i use the encoded Polyline in that kind of call in Google API like i'm doing now without Polyline or i'm doing something wrong ?
You are missing enc:
: static map with encoded string
https://maps.googleapis.com/maps/api/staticmap?size=1000x500&maptype=roadmap&markers=icon:http://api.appcargo.com/app_images/ic_pin.png%7C44.80006858,20.4791788&markers=icon:http://api.appcargo.com/app_images/ic_pin_destination_toolbar.png%7C44.8013566,20.4804733&path=color:0xff0000ff%7Cweight:5%7Cenc:m_mpG%7By~%7BBi@p@yF_F%60@sA&format=jpg
From the documentation:
Encoded Polylines
Instead of a series of locations, you may instead declare a path as an encoded polyline by using the enc: prefix within the location declaration of the path. Note that if you supply an encoded polyline path for a map, you do not need to specify the (normally required) center and zoom parameters.