Hi, I'm using the Static Maps API to display a map with a path in an image column, using polyline encoding.
However, some URLs work while others don't, and I suspect it may be due to special characters in the polyline.
Example of a polyline that works: ld~eEfw}qJ}Gwu@yY|RjFni@
excample polyline that doesnt works:
Example of a polyline that doesn't work: lzdiExhmpJgK_uAQcDg@aIeBqGoA^yCbDcF`Ci@xA`@rArN`oB
example of complete URL (without key):
https://maps.googleapis.com/maps/api/staticmap?size=650x650&maptype=hybrid&style=feature:administrative%7Cvisibility:off&style=feature:landscape%7Cvisibility:off&style=feature:poi%7Cvisibility:off&path=color:0x00000000%7Cweight:5%7Cfillcolor:0xca25ff50%7Cenc:lzdiExhmpJgK_uAQcDg@aIeBqGoA^yCbDcF`Ci@xA`@rArN`oB&markers=color:0xf9b137%7Clabel:A%7C-33.123423, -60.513979 &markers=color:0xf9b137%7Clabel:B%7C-33.124912, -60.515218 &markers=color:0xf9b137%7Clabel:C%7C-33.120917, -60.514662 &markers=color:0xf9b137%7Clabel:D%7C-33.123849, -60.520007&key=
I tried this URL in Chrome and Edge without success, but strangely, I used the same URL to generate a PDF with a bot, and it worked perfectly, displaying the maps I wanted in the generated PDF.
I hope someone can help me. Thanks!
We are experiencing the exactly same issue. We have app with image columns where google static map url with encoded path is set as value. It has been working fine without problem and we see the static map inside the app. However, it started not to work all the sudden without changing anything to the app. We are perfectly sure our API key is active. Likely Google/AppSheet made some background changes without we knowing.
@devingu @lizlynch Could you please investigate with dev team?
After making the post, I found a solutionโperhaps temporary, but it worked. The problem was with the special character ` in the polyline. I had tried using ENCODEURL([polylinecode]), but it didnโt work. Finally, I used SUBSTITUTE([polylinecode],"`","%60")
Thanks for sharing the workaround. I would test the same tomorrow. However, the things working fine start to stop to service, something wrong with the platform. However, reporting to the support desk to Google never solve any single problem at all. So I would trust your solution. If it does not work, I will seek alternative to serve to my end customers...
It's true, this problem appeared overnight. The strange thing is that while the URL wasn't working in AppSheet or Chrome, when generating a PDF, the URL perfectly returned the image.
Keep me updated if you find a better or definitive solution. Best regards.
We say loudly here in this community, no Google team seeing our voice and frustration..., as issue not for them but for their re-seller due to their sales structure.
This appears to be a regression in the static maps API. Here is the bug tracker: https://issuetracker.google.com/issues/373192613
Hopefully they will restore compatibility since this seems pretty disruptive. In the meantime they suggest the same workaround you found, to url-encode the polyline. From your example url it looks like the overall path is encoded except for the polyline.
I had tried using ENCODEURL([polylinecode]), but it didnโt work. Finally, I used SUBSTITUTE([polylinecode],"`","%60")
That sounds like a problem with the ENCODEURL function, but I wasn't able to reproduce it. When I try `ENCODEURL("lzdiExhmpJgK_uAQcDg@aIeBqGoA^yCbDcF`Ci@xA`@rArN`oB")` I get "lzdiExhmpJgK_uAQcDg%40aIeBqGoA%5EyCbDcF%60Ci%40xA%60%40rArN%60oB". Maybe there's something different about your overall expression?
In the ticket they mention the original url still works with HTTP1.1 protocol. That might be why it still works with PDF generation, if HTTP1.1 is used there.
User | Count |
---|---|
18 | |
15 | |
10 | |
7 | |
4 |