public static function locate($address)
	{
		$ip = false;
		if (filter_var($address, FILTER_VALIDATE_IP))
		{
			$ip = true;
		}

		$adapter  = new \Geocoder\HttpAdapter\CurlHttpAdapter();

		$p = array();

		// Get a list of providers
		if ($providers = \Event::trigger('geocode.onGeocodeProvider', array('geocode.locate', $adapter, $ip)))
		{
			foreach ($providers as $provider)
			{
				if ($provider)
				{
					$p[] = $provider;
				}
			}
		}

		if (!count($p))
		{
			return '';
		}

		// Instantiate the Geocoder service and pass it the list of providers
		$geocoder = new \Geocoder\Geocoder();
		$geocoder->registerProvider(new \Geocoder\Provider\ChainProvider($p));

		// Try to get some data...
		return $geocoder->geocode($address);
	}
public static function locate($address)
	{
		$ip = false;
		if (filter_var($address, FILTER_VALIDATE_IP))
		{
			$ip = true;
		}

		$adapter  = new \Geocoder\HttpAdapter\CurlHttpAdapter();

		$p = array();

		// Get a list of providers
		if ($providers = \Event::trigger('geocode.onGeocodeProvider', array('geocode.locate', $adapter, $ip)))
		{
			foreach ($providers as $provider)
			{
				if ($provider)
				{
					$p[] = $provider;
				}
			}
		}

		if (!count($p))
		{
			return '';
		}

		// Instantiate the Geocoder service and pass it the list of providers
		$geocoder = new \Geocoder\Geocoder();
		$geocoder->registerProvider(new \Geocoder\Provider\ChainProvider($p));

		// Try to get some data...
		return $geocoder->geocode($address);
	}
public static function locate ( $ address ) { $ ip = false ; if ( filter_var ( $ address , FILTER_VALIDATE_IP ) ) { $ ip = true ; } $ adapter = new \ Geocoder \ HttpAdapter \ CurlHttpAdapter ( ) ; $ p = array ( ) ; // Get a list of providers if ( $ providers = \ Event :: trigger ( 'geocode.onGeocodeProvider' , array ( 'geocode.locate' , $ adapter , $ ip ) ) ) { foreach ( $ providers as $ provider ) { if ( $ provider ) { $ p [ ] = $ provider ; } } } if ( ! count ( $ p ) ) { return '' ; } // Instantiate the Geocoder service and pass it the list of providers $ geocoder = new \ Geocoder \ Geocoder ( ) ; $ geocoder -> registerProvider ( new \ Geocoder \ Provider \ ChainProvider ( $ p ) ) ; // Try to get some data... return $ geocoder -> geocode ( $ address ) ; }
Geo-locate an address

@param   string  $address
@return  array
Geo - locate an address