I want to set a basic static map image on my site and so want to use the Google Maps Static API.
I've followed the documentation here: https://developers.google.com/maps/documentation/maps-static/dev-guide
And have built an image link as such:
<img src="https://maps.googleapis.com/maps/api/staticmap?center=Berkeley,CA&zoom=14&size=400x400&key=ABC123">
But it doesn't work - all I see is a broken image. I've tried several of my API keys, but with no luck.
Is there something I am missing? Some other parameter I need?
Remove the HTML encoding from the URL (&
should be &
). This works for me:
<img src="https://maps.googleapis.com/maps/api/staticmap?center=Berkeley,CA&zoom=14&size=400x400" />