From 458f1449cb262b73884170b9a0ea6a2b5485cacd Mon Sep 17 00:00:00 2001 From: bfabiszewski Date: Fri, 21 Jun 2013 12:44:57 +0200 Subject: [PATCH] correct Google API key handling --- index.php | 1 + main.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index a2a4d9b..2149b2b 100755 --- a/index.php +++ b/index.php @@ -105,6 +105,7 @@ print var lang_newinterval = "'.$lang_newinterval.'"; var units = "'.$units.'"; var mapapi = "'.$mapapi.'"; + var gkey = '.(isset($gkey)?'"'.$gkey.'"':'null').'; '; diff --git a/main.js b/main.js index 5fa8d19..12a2525 100755 --- a/main.js +++ b/main.js @@ -287,7 +287,7 @@ function loadMapAPI(api) { var url = new Array(); if (api=='gmaps') { url.push('api_gmaps.js'); - url.push('https://maps.googleapis.com/maps/api/js?sensor=false&callback=init'); + url.push('https://maps.googleapis.com/maps/api/js?'+((gkey!==null)?('key='+gkey+'&'):'')+'sensor=false&callback=init'); } else { url.push('api_openlayers.js');