diff --git a/lib/GMapClient.class.php b/lib/GMapClient.class.php index 2cb2900..bb1017a 100644 --- a/lib/GMapClient.class.php +++ b/lib/GMapClient.class.php @@ -30,6 +30,7 @@ class GMapClient const API_URL = 'http://maps.google.com/maps/geo?'; const JS_URL = 'http://maps.google.com/maps/api/js?sensor=false'; + const JS_URL_SSL = 'https://maps-api-ssl.google.com/maps/api/js?sensor=false'; /** * @@ -177,6 +178,7 @@ public static function getAPIKeyByDomain($domain, $api_keys = null) } else { + return null; // no exception as the API key is not required with v3 API throw new sfException('No Google Map API key defined in the app.yml file of your application'); } } @@ -266,7 +268,7 @@ public function hasCache() */ public function getGoogleJsUrl($auto_load = true, $language = null, $region = null) { - $js_url = self::JS_URL; + $js_url = sfContext::getInstance()->getRequest()->isSecure() ? self::JS_URL_SSL : self::JS_URL; if ($language !== null) { diff --git a/lib/helper/GMapHelper.php b/lib/helper/GMapHelper.php index d528419..372a1f5 100644 --- a/lib/helper/GMapHelper.php +++ b/lib/helper/GMapHelper.php @@ -30,6 +30,9 @@ function include_map_javascript($gMap) $gMap = $gMap->getRawValue(); } + // Force locale temporarily to avoid JS code with comma in decimal numbers + $locale = setlocale(LC_NUMERIC, 0); + setlocale(LC_NUMERIC, 'en_US'); ?>