I am new to Google Cloud and Google Map. I want to have a HTML file that display a Google Map; everything is saved in a Google Cloud bucket. I am not a JavaScript, Google Cloud/Google Map or IT guru, just try and learn on the go…!
I am using “word-for-word” this example, provided by Google:
https://developers.google.com/maps/documentation/javascript/adding-a-google-map
So far, what I have:
- a Google Map API key
- a Google Cloud bucket, named bucket001 (random name for illustration purpose…)
In bucket001, I have the index.html, the index.js and style.css saved at the root of bucket001.
In index.html, the only change I did was to add my Google Map API key; no other changes.
When I access the public URL https://storage.googleapis.com/bucket001/index.html, I only got “My Google Maps Demo” displayed, then “Oops! Something went wrong. This page didn’t load Google Maps correctly. See the JavaScript console for technical details.“
Accessing the JavaScript console shows me: “js?libraries=maps&ke…gle.maps.ib:144 Google Maps JavaScript API error: RefererNotAllowedMapError“
Google Map helps tells me more about the RefererNotAllowedMapError, but I can’t find a way to get it work. I tried several combination with or without restriction on the API key, but I always get the same error message (after waiting 5 min each time…)
Hello,
I am new to Google Cloud and Google Map. I want to have a HTML file that display a Google Map; everything is saved in a Google Cloud bucket. I am not a JavaScript, Google Cloud/Google Map or IT guru, just try and learn on the go…!
I am using “word-for-word” this example, provided by Google:
https://developers.google.com/maps/documentation/javascript/adding-a-google-map
So far, what I have:
- a Google Map API key
- a Google Cloud bucket, named bucket001 (random name for illustration purpose…)
(I initially tried to run the index.html, the index.js and style.css directly local from my computer, but no luck displaying the map)
In bucket001, I have the index.html, the index.js and style.css saved at the root of bucket001.
In index.html, the only change I did was to add my Google Map API key; no other changes.
the API key has no restrictions: I want to make sure the basis works before I start to increase the restriction level. The API key is as follow:
- Set an application restriction = none
- API restrictions = Don’t restrict key
When I access the public URL https://storage.googleapis.com/bucket001/index.html, I only got “My Google Maps Demo” displayed, then “Oops! Something went wrong. This page didn’t load Google Maps correctly. See the JavaScript console for technical details.“
The good thing is that the basic HTML info is displayed; the bad thing is that the Google Map is not!
Accessing the JavaScript console shows me: “js?libraries=maps&ke…gle.maps.ib:144 Google Maps JavaScript API error: RefererNotAllowedMapError“
Google Map helps tells me more about the RefererNotAllowedMapError, but I can’t find a way to get it work. I tried several combination with or without restriction on the API key, but I always get the same error message (after waiting 5 min each time…)
Anybody has any idea on what I could try next to make this basic example work, ideally from Google Cloud?
Thank you very much for your help!
Sierra Alpha is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.