Skip to content
Snippets Groups Projects
Commit 75204132 authored by Tom Robinson's avatar Tom Robinson
Browse files

Google Maps API key setting

parent 4ef49905
Branches
Tags
No related merge requests found
......@@ -46,6 +46,11 @@ const SECTIONS = [
key: "enable-advanced-humanization",
display_name: "Friendly Table and Field Names",
type: "boolean"
},
{
key: "google-maps-api-key",
display_name: "Google Maps API Key",
type: "string"
}
]
},
......
......@@ -33,7 +33,8 @@
loadScript('https://ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js', function () {
WebFont.load({ google: { families: ["Lato:n3,n4,n7"] } });
});
loadScript('https://maps.googleapis.com/maps/api/js');
loadScript('https://maps.googleapis.com/maps/api/js' +
(window.MetabaseBootstrap.google_maps_api_key ? "?key=" + encodeURIComponent(window.MetabaseBootstrap.google_maps_api_key) : ""));
var googleAuthClientID = window.MetabaseBootstrap.google_auth_client_id;
if (googleAuthClientID) {
......
......@@ -46,6 +46,9 @@
:type :boolean
:default true)
(defsetting google-maps-api-key
"A Google Maps API key is required to enable certain map visualizations.")
(defn site-url
"Fetch the site base URL that should be used for password reset emails, etc.
This strips off any trailing slashes that may have been added.
......
......@@ -46,4 +46,5 @@
:report_timezone (setting/get :report-timezone)
:timezone_short (short-timezone-name (setting/get :report-timezone))
:has_sample_dataset (db/exists? 'Database, :is_sample true)
:google_auth_client_id (setting/get :google-auth-client-id)})
:google_auth_client_id (setting/get :google-auth-client-id)
:google_maps_api_key (setting/get :google-maps-api-key)})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment