0

I am trying to get the Google Map Static Image which show both origin,destination along with poly line using the Encoded Route data which I have but I was not able see anything on the map.

below is the link which I am using

`https://maps.googleapis.com/maps/api/staticmap?size=600x400&path=enc:i}cyHdpc@@?L?@bBAZERwHhNw@zBONULXbC}FjAwBh@eGbB[LGJW]gAmB_@w@_@w@_HnLgDrFqAhBSTQDMn@QfAcApF?^B\\Rl@z@xAL`@IR]RqA\\YF]@c@NcALWPWZeBbBuFdE}D~CuBlAgA~@c@\\OCy@b@eBb@_DpAuDjBw@n@]v@c@tBe@fBWj@k@d@mExByB|@qBpAYFgABc@N}@f@s@l@e@b@_AvA{E|JoAvB_ApAKLaCaH[kBW{CEa@GcBQ}AUuAg@}BsCcKiDgN_AwDmBxAkB`BWm@KoAWQMB&key={API_KEY}`

Things to note :

  1. My URL is below 2000 characters
  2. I am using path parameter as per documentation using enc: tag
  3. I have tried replacing \\ with \\\\ as mentioned here

but none of them worked out.is there anything here which I am missing ?

Community
  • 1
  • 1
Nagarjuna Yelisetty
  • 539
  • 1
  • 6
  • 12

1 Answers1

1

Google Maps Polyline Decoder

If you carefully check Google Maps Polyline Utility it is appending @ at the end of the encoded polyline entered.

by appending @ at the end of the Encoded polyline path I was able to get the Google Static Image with path drawn on it.

Valid Link:

https://maps.googleapis.com/maps/api/staticmap?size=600x400&path=enc%3Ai}cyHdpc@@?L?@bBAZERwHhNw@zBONULXbC}FjAwBh@eGbB[LGJW]gAmB_@w@_@w@_HnLgDrFqAhBSTQDMn@QfAcApF?^B\\\\Rl@z@xAL`@IR]RqA\\\\YF]@c@NcALWPWZeBbBuFdE}D~CuBlAgA~@c@\\\\OCy@b@eBb@_DpAuDjBw@n@]v@c@tBe@fBWj@k@d@mExByB|@qBpAYFgABc@N}@f@s@l@e@b@_AvA{E|JoAvB_ApAKLaCaH[kBW{CEa@GcBQ}AUuAg@}BsCcKiDgN_AwDmBxAkB`BWm@KoAWQMB@
Nagarjuna Yelisetty
  • 539
  • 1
  • 6
  • 12
  • I think the `@` symbol is very hit and miss, sometimes you need it, sometimes you don't, which is very confusing. – Dolan Jul 02 '22 at 13:22