saey55 / hugo-elate-theme

A one page parallax theme with animation for Hugo
MIT License
192 stars 103 forks source link

"This page can't load Google Maps correctly" #37

Closed raklein closed 5 years ago

raklein commented 5 years ago
screen shot 2018-09-27 at 12 16 55
tsauvajon commented 5 years ago

Google added a limit to the API usage. https://cloud.google.com/maps-platform/pricing/sheet/

While we previously had unlimited Google maps queries (I think), it's now heavily limited.

Since the default key is probably used by hundreds if not thousands of websites, you might want to get your own Google maps API key: https://developers.google.com/maps/documentation/javascript/get-api-key.

Please note that enabling billing with Google is required, as far as I know (even though it will never cost you anything unless you explicitly agree to it).

Once you've got your new API key, open layouts/partials/js.html, find the line where the default key is: "https://maps.googleapis.com/maps/api/js?key=AIzaSyCefOgb1ZWqYtj7raVSmN4PL2WkTrc-KyA&sensor=false", and replace it with your own key, as following: "https://maps.googleapis.com/maps/api/js?key=[YOUR_KEY]&sensor=false".

Be sure to restrict how the key can be used to avoid anyone else from using it ! You can do that in the Console: add both referrers (in my case, my website is published at https://thomas.sauvajon.tech so I added that as a referrer: only requests coming from this website will work), and what API can be used with this key (once again in my case, only JavaScript API).

raklein commented 5 years ago

Great, thanks for the clear explanation. Fixed on my end, maybe just needs a little note in the readme.