Geocoder\Geocoder::geocode PHP Method

geocode() public method

Geocodes a given value.
public geocode ( string $value ) : Geocoder\Model\AddressCollection
$value string
return Geocoder\Model\AddressCollection
    public function geocode($value);

Usage Example

 /**
  * Get address from requested param
  *
  * @param string $param
  * @throws \Sonar\Exceptions\GeoServiceException
  * @return array
  */
 public function location($param)
 {
     try {
         $result = $this->geocoder->geocode($param);
         // parse  data from geo locator
         return (new Geo($result))->toArray();
     } catch (\Exception $e) {
         throw new GeoServiceException($e->getMessage());
     }
 }
All Usage Examples Of Geocoder\Geocoder::geocode