From 277e004fc052189b5a0dab7aba77d00ca435e7dc Mon Sep 17 00:00:00 2001 From: Jason Irish Date: Fri, 8 Apr 2016 14:49:04 -0500 Subject: [PATCH] Google API Key uses config from GoogleGeocoding in Addressable fixes #85 --- code/Locator.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/Locator.php b/code/Locator.php index b166899..64812a4 100644 --- a/code/Locator.php +++ b/code/Locator.php @@ -100,9 +100,12 @@ public function init() $themeDir = SSViewer::get_theme_folder(); + // google maps api key + $key = Config::inst()->get('GoogleGeocoding', 'google_api_key'); + Requirements::javascript('framework/thirdparty/jquery/jquery.js'); if (Locator::getLocations()) { - Requirements::javascript('http://maps.google.com/maps/api/js?sensor=false'); + Requirements::javascript('http://maps.google.com/maps/api/js?key='.$key); Requirements::javascript('locator/thirdparty/handlebars/handlebars-v1.3.0.js'); Requirements::javascript('locator/thirdparty/jquery-store-locator/js/jquery.storelocator.js'); }