Example #1
0
 /**
  * Retrieves the latitude and longitude of an address.
  *
  * @param string $address address
  * @return array longitude, latitude
  */
 public static function address_to_ll($address)
 {
     $lat = NULL;
     $lon = NULL;
     if ($xml = Gmap::address_to_xml($address)) {
         // Get the latitude and longitude from the Google Maps XML
         // NOTE: the order (lon, lat) is the correct order
         list($lon, $lat) = explode(',', $xml->Response->Placemark->Point->coordinates);
     }
     return array($lat, $lon);
 }