4

I am trying to render google maps with the following link inside QlikView application

The error message I am getting is (not in QlikView, but in browser, when I try to render the link using browser):

  • The Google Maps API server rejected your request. This site or IP is not authorized to use this API key.

I have actvated following Google services on my account:

  • Google Maps Android API v2
  • Google Maps JavaScript API v3
  • Static Maps API
  • Translate API

Already found this thread on StackOverflow: The Google Maps API server rejected your request

I have tried the following:

  • make sure the Referers is set to Any referer allowed
  • Make sure you have enabled "Static Maps API" service in addition to "Google Maps API".

Unfortunately, I am still getting the same error message. Can anyone help please? Thanks.

Community
  • 1
  • 1
Adam
  • 2,347
  • 12
  • 55
  • 81
  • 1
    Do you actually have a **valid** key? – Lee Taylor May 26 '14 at 15:00
  • 1
    You can always try to generate a new key, if that is an option. – MrUpsidown May 26 '14 at 15:01
  • @LeeTaylor: how can I check it? – Adam May 26 '14 at 15:04
  • @MrUpsidown: tried it already... – Adam May 26 '14 at 15:04
  • How does your *Referers* look like? – MrUpsidown May 26 '14 at 15:07
  • @MrUpsidown: "Key for browser apps (with referers) -> Referrers: Any referer allowed" – Adam May 26 '14 at 15:13
  • So you just have a *star* (*), right? – MrUpsidown May 26 '14 at 15:14
  • "Accept requests from these HTTP referers (web sites):" I have tried with and without star - same error msg – Adam May 26 '14 at 15:16
  • Strange. From your wording I assume you are using the *old* console. Have you eventually tried with the new console? https://console.developers.google.com/project No idea why that would change anything, but who knows... – MrUpsidown May 26 '14 at 15:22
  • @MrUpsidown: I have tried it also with a new console – Adam May 26 '14 at 15:24
  • 1
    I am almost out of ideas. Double check the key, regenerate, empty your browser cache, clear any cache in QlikView (?), double check the output HTML... – MrUpsidown May 26 '14 at 15:36
  • This thing is driving me crazy... I have tried it with another key using my other Google Account, and it's still not working. I am testing it from my company's intranet. Does that have any influence? – Adam May 27 '14 at 09:41
  • Have you allowed your site in the "Edit allowed referrers" section (see https://developers.google.com/maps/documentation/javascript/tutorial )? Doing this in a corporate environment brings a host of other possibilities. I'd make sure that the site is in the trusted or intranet sites zone, since if not, it's possible that something in Group Policy is blocking. – vapcguy Sep 10 '14 at 00:28

2 Answers2

1

generate key from https://console.developers.google.com/ for maps api of type browser key. And make sure that while calling document.referrer should be set to your domain.

Sébastien
  • 11,860
  • 11
  • 58
  • 78
Shan
  • 11
  • 1
0

Google API keys are binded to Domain Names, if you request a Google Service from a site that is not whitelisted the request gets tossed.

Go to your Google Console. https://console.developers.google.com/ Click in the left Menu API's & Auth then Credential

Under Public API access click create new key and choose on the next Page Browser Key. You are now forced to enter all Domain Names that are allowed to make API request with this key.

Enter your Domain names use the new key and you should ready to go.

ins0
  • 3,918
  • 1
  • 20
  • 28