Release of plat/al 1.1.8
[platal.git] / classes / gmapsgeocoder.php
index 2e44a01..bea3a52 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2011 Polytechnique.org                              *
+ *  Copyright (C) 2003-2013 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -32,13 +32,16 @@ class GMapsGeocoder extends Geocoder {
 
     static public function buildStaticMapURL($latitude, $longitude, $color, $separator = '&')
     {
+        if (!$latitude || !$longitude) {
+            return null;
+        }
+
         $parameters = array(
             'size'    => '300x100',
             'markers' => 'color:' . $color . '|' . $latitude . ',' . $longitude,
             'zoom'    => '12',
             'sensor'  => 'false'
         );
-        global $globals;
 
         return Platal::globals()->maps->static_map . '?' . http_build_query($parameters, '', $separator);
     }