最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to fix "this page can't load google maps correctly" error - Stack Overflow

programmeradmin4浏览0评论

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=";v=2&key=ABQIAAAAYuhugTQ8HWA2RX4tkBQyIbvbe-f2nKDf2uCI5Rwpq3vfPBRkDwxy87YO1o-kJbvMl8dG_FNpRQ" type="text/javascript">

And the new version:

<script src=";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="" 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.

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./maps?file=api&v=2&key=ABQIAAAAYuhugTQ8HWA2RX4tkBQyIbvbe-f2nKDf2uCI5Rwpq3vfPBRkDwxy87YO1o-kJbvMl8dG_FNpRQ" type="text/javascript">

And the new version:

<script src="http://maps.google./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./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.

Share Improve this question asked Nov 6, 2018 at 17:48 user1149499user1149499 5834 gold badges13 silver badges34 bronze badges 2
  • 1 FYI (probably not the issue), you are using the deprecated and turned off Google Maps Javascript API v2, that was turned off many years ago, replaced with a wrapper for v3. If it is a map you care about or that is under development, you should really port it to v3. – geocodezip Commented Nov 6, 2018 at 18:13
  • You might need to use a v2 key with that map. – geocodezip Commented Nov 6, 2018 at 18:14
Add a ment  | 

1 Answer 1

Reset to default 3

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.

发布评论

评论列表(0)

  1. 暂无评论