All Apps and Add-ons

API key required for Google Maps Add-on

sc0tt
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?

sc0tt
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

pjpmccarthy
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!

laudai
Path Finder

thank you , it is bother me long time

0 Karma

ragedsparrow
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.

Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

Splunk is officially part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint.   Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...