Reputation: 35
I have the following Google Developer Console APIs with ON status:
I have the following link in an HTML email:
<img src='http://maps.google.com/staticmap?center=-15,-47&zoom=11&size=600x200&key=myKey'/>
But I never get an image. The key works OK for an embedded map using an iframe.
What am I doing wrong?
Upvotes: 2
Views: 1724
Reputation: 191
If you are using Google static Map API, you should use this URL:
http://maps.googleapis.com/maps/api/staticmap?center=-15,-47&zoom=11&size=600x200&key=myKey
Of course, replace 'myKey' to your valid key.
Upvotes: 1
Reputation: 6737
It won't work because you're trying to put it in an email, browsers work differently to email clients. Email clients block iframes for security purposes, see:
Is there no way to embed a Google Map into an HTML email?
You can check if your api key is working using the Google Maps API console https://code.google.com/apis/console/?pli=1
Update
also you might want to update the bit of the string 'myKey' with your api key :)
Upvotes: 0