最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - Google Maps won't work when API key is providedThis page was unable to display a Google maps element - Stac

matteradmin2PV0评论

I've been using google maps API V3 for a while now and it was working fine. Yesterday i tried adding Static Maps API to my application and i encountered an error where the image was either not displayed at all or i get an error saying 'InvalidKeyOrUnauthorizedMapError' which tells me something must be wrong with the api key i've been using, but i use the same key with other scripts in my application and they worked fine. I double-checked with developer's console and made sure the Static Maps API is activated and the key is correct. Then i removed the api key from the static image link request and it worked, but i noticed all my other scripts, using this key stopped working displaying these errors:

This page was unable to display Google Maps Element

and the console says:

UrlAuthenticationCommonError: . Regenerating the api key didn't work. Removing the key or using a key from a different account with the same settings in developer's console solves the problem, but i need it to be under this account for billing purposes

TLDR; My application suddenly works only without API key or with a key from another google developer account with the exact same settings. What may be causing the problem with this particular account?

I've been using google maps API V3 for a while now and it was working fine. Yesterday i tried adding Static Maps API to my application and i encountered an error where the image was either not displayed at all or i get an error saying 'InvalidKeyOrUnauthorizedMapError' which tells me something must be wrong with the api key i've been using, but i use the same key with other scripts in my application and they worked fine. I double-checked with developer's console and made sure the Static Maps API is activated and the key is correct. Then i removed the api key from the static image link request and it worked, but i noticed all my other scripts, using this key stopped working displaying these errors:

This page was unable to display Google Maps Element

and the console says:

UrlAuthenticationCommonError: https://developers.google./maps/faq#errorcodes . Regenerating the api key didn't work. Removing the key or using a key from a different account with the same settings in developer's console solves the problem, but i need it to be under this account for billing purposes

TLDR; My application suddenly works only without API key or with a key from another google developer account with the exact same settings. What may be causing the problem with this particular account?

Share Improve this question asked Aug 20, 2015 at 14:48 Radoslav TrenevRadoslav Trenev 3731 gold badge6 silver badges18 bronze badges 1
  • Did you set up your key using the link provided here? – not_a_bot Commented Aug 20, 2015 at 19:52
Add a ment  | 

2 Answers 2

Reset to default 2

I guess it was some bug with my account. I disabled and deleted all APIs and keys, re-enabled and re-created them and the problem was fixed.

I fixed,

In the console say to add a link in this format:

*.example./*

I changed to this:

*example./*

And it worked!

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far