Browse Source

add api key to gmap geocode call

SiM 3 years ago
parent
commit
d71535eeef
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/utils/utils.class.php

+ 1 - 1
lib/utils/utils.class.php

@@ -192,7 +192,7 @@ class Utils {
     }
 
     public static function getLatLng($address) {
-        $xml = simplexml_load_string(utf8_encode(file_get_contents(sprintf('https://maps.googleapis.com/maps/api/geocode/xml?address=%s&sensor=false', urlencode($address)))));
+        $xml = simplexml_load_string(utf8_encode(file_get_contents(sprintf('https://maps.googleapis.com/maps/api/geocode/xml?address=%s&sensor=false&key='.sfConfig::get('app_gmap'), urlencode($address)))));
 
         if ($xml->status ==  'OK') {
             // Adresse correcte