It has to be something with the API key settings. Maybe the IP address restrictions don't have the domain you are listing. I updated the page to use my API key and it works, so the problem isn't with the code on the page it is in the google settings.
From the same google console:
1) click on the credentials tab
2) select the api credentials you are using
3) where it says "key restrictions" choose 'none'
also make sure you have the credentials entered correctly