Archive
Highlighted

API key required for Google Maps Add-on

Builder

We have an internal dashboard that has been using the Google Maps app. We are now getting the below message:

Oops! Something went wrong.
This page didn't load Google Maps correctly. See the JavaScript console for technical details.

The Javascript console shows "Google Maps API error: MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error";

It seems that Google now requires an API.
Have others encountered this?

Where exactly should the key be added in the app?

Highlighted

Re: API key required for Google Maps Add-on

SplunkTrust
SplunkTrust

Hey sc0tt! I think I may have found it. I was troubleshooting the same issue you were as well. Here is what fixed it to me.

You have to modify the GoogleMaps.js file at $SPLUNK_HOME/maps/appserver/modules/GoogleMaps/

Look for this line in the javascript file:

s.src = "//maps.google.com/maps/api/js?sensor=false&version=v3.6&callback=_gmapsOnLoad";

Replace it with:

s.src = "https://maps.googleapis.com/maps/api/js?key=<YOUR_API_KEY>&callback=initMap";

You will need to have an API Key already to insert in the link, but it should work. I was able to load the Google Maps after I replaced this and restarted Splunk.

Highlighted

Re: API key required for Google Maps Add-on

Engager

All,

This got me most of the way there. I'm running Splunk v6.4.2 and from what I have read Google Maps is not officially supported under v6. I attempted the above fix but the maps would not load but instead hung on "Initializing maps". After looking through some browser console output I saw that the initMap function was not found. I then changed the s.src string to this:

s.src = "https://maps.googleapis.com/maps/api/js?key=API_KEY&callback=_gmapsOnLoad";

Maps now load and I'm able to map the source IPs of my firewall drops onto a map. Very cool!

Highlighted

Re: API key required for Google Maps Add-on

Path Finder

thank you , it is bother me long time

0 Karma
Highlighted

Re: API key required for Google Maps Add-on

Builder

For some unknown reason, this error has gone away and the maps now loads normally (6.2).
Since I haven't tested any of the given answers, I'll just vote for them and leave the question unanswered.

0 Karma