Ejemplo n.º 1
0
 public function geolocate(Location $location)
 {
     //this will only work for western europe because the format may be different for other countries... big switch
     //may be needed...
     $address = $location->getStreetNumber() . '+' . $location->getStreet() . '+' . $location->getPc() . '+' . $location->getTown() . '+' . $location->getCountry();
     $address = urlencode($address);
     $query = 'https://maps.googleapis.com/maps/api/geocode/json?address=' . $address . '&key=' . $this->ch->getParameter('google_geocoding_key');
     return $this->cm->exec($query);
 }