user1149499
user1149499

Reputation: 583

How to fix "this page can't load google maps correctly" error

I have run a website that is probably 10 years old at this point that has a map with custom points plotted on it. Recently I've noticed that this map says "For Development Purposes Only" and has an error alert: "This page can't load Google Maps correctly" and it says "Are you the owner of the website?"

I went through the process of setting up billing and generated an API key. But when I plug that key into the ONLY spot where there's an API key in the existing code, it fails with a "Oops! Something went wrong. This page didn't load Google Maps correctly. See the JavaScript console for technical details."

This is the code difference:

<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAYuhugTQ8HWA2RX4tkBQyIbvbe-f2nKDf2uCI5Rwpq3vfPBRkDwxy87YO1o-kJbvMl8dG_FNpRQ" type="text/javascript">

And the new version:

<script src="http://maps.google.com/maps?file=api&v=2&key=AIzaSyDLRgUHjuLTn7s629OxjVujuHOROcvB8" type="text/javascript">

After Googling and searching I found a bit of different syntax and thought perhaps that was the problem, so I tried that. It also failed:

<script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyDLRgUHjuLTn7s629OxjVujuHOROcvB8" type="text/javascript">

(Note, I have altered these keys, they are not MY keys.)

I was hoping that the new API key would simply plug into the existing code and work, as I am not sure even where to start in the full code. Does anyone know if there are any glaring errors with this? Am I missing something obvious?

I know I haven't included the pages and pages of code, but that's because my impression was that an api-key is used once and the code should work whether it's key A or key B, as long as the key is correct.

Is my key perhaps not for use with Google Maps but some other key? Is there some additional "switch" to turn on for this to work?

Any help would be greatly appreciated. Thank you in advance.

Upvotes: 1

Views: 17488

Answers (1)

user1149499
user1149499

Reputation: 583

In the hour or so since posting I believe I've answered my own question: AFTER making the API key, there's an additional step, probably obvious to any programmer but not to me at the time...you have to "Enable" the APIs for use with your site.

I did this here: https://console.developers.google.com

Upvotes: 3

Related Questions