3

I can display a google static map image in my site. I create

<img src="url"/> 

with the same url in email. The image is displayed but very different way (i,e the map of the world).

I inspected the element in chrome, and I see that the mail server added a "proxy" url in front of it ( https://ci6.googleusercontent.com/proxy... ) and changed the elements-tags (e.g. &= &).

I removed the proxy manually, and it didn't help.
I changed the '& to & and it didn't help. Only when I manually changed the element to the original URL I see the right image.

Is there a way to send it via email?


Now I have some more data that may explain this problem. I created another image and displayed it in IE browser - it works OK, showing the right image. I tried to display it in Chrome, it returns and error: 400. That’s an error. Your client has issued a malformed or illegal request. That’s all we know.

Rob
  • 26,989
  • 16
  • 82
  • 98
Shlomo
  • 357
  • 3
  • 11
  • Now I have some more data thatmay explain this problem. I created anothe image and displayed it in IE browser - it works OK, showing the right image. I tryed to display it in Chrome, it returns and error: 400. That’s an error. Your client has issued a malformed or illegal request. That’s all we know. – Shlomo Mar 20 '15 at 10:27

2 Answers2

2

You can send the static map via email if you use the google static map api (maps.googleapis.com/maps/api/staticmap) to generate the image. According with Google's Terms of Service what you can NOT do is store the image in your server.

Rafael
  • 21
  • 2
1

This is a violation of Google's Terms of Services for Google Static Maps API.
You can not share (read as attachments) the static map images via email. Please be careful and read important documentations before using any service/tool.

It is however allowed to embed it in HTML with a <img src=""> element.

EDIT

Verbatim from Google Maps APIs FAQ (link shared inline above):

Can I generate a map image using the Google Static Maps API which I store and serve from my website?

You may not store and serve copies of images generated using the Google Static Maps API from your website. All web pages that require static images must link the src attribute of an HTML img tag or the CSS background-image attribute of an HTML div tag directly to the Google Static Maps API so that all map images are displayed within the HTML content of the web page and served directly to end users by Google.

EDIT 2

Sorry, I seemed to have misunderstood the original query when I answered here. This is NOT a violation of Google's ToS but a valid use-case as long as these images of Static Maps are not being stored somewhere in your system.

Kay_N
  • 987
  • 5
  • 12
  • I don't see how emailing a link to a static image is a violation of Google's Static Maps ToS. Please explain. – rob Mar 30 '17 at 15:26
  • There you go. Only use-case allowed is to embed it and serve directly to end user. – Kay_N Mar 31 '17 at 18:49
  • Unless I'm misunderstanding the question, the OP is asking how to display the generated static map image via email. How is this related to "storing and serving copies" of said image? The trouble the OP is having seems to fall more in line with: http://stackoverflow.com/questions/20903967 – rob Mar 31 '17 at 19:55
  • Yeah sorry seems like I did misunderstand. But if you see the first post by the OP, it wasn't that clear as it appears now. I didn't return to this until I saw your comment. Thanks for clarifying. And hey, doesn't hurt to iterate over ToS in case someone is planning to use it that way. :) – Kay_N Mar 31 '17 at 21:44