PHP Class Geocoder\Provider\OpenCage

Author: mtm ([email protected])
Inheritance: extends AbstractHttpProvider, implements Geocoder\Provider\LocaleAwareProvider, use trait Geocoder\Provider\LocaleTrait
Show file Open project: willdurand/geocoder Class Usage Examples

Public Methods

Method Description
__construct ( Http\Client\HttpClient $client, string $apiKey, boolean $useSsl = false, string | null $locale = null )
geocode ( $address )
getName ( )
reverse ( $latitude, $longitude )

Protected Methods

Method Description
guessBestComponent ( array $components, array $keys ) : null | string
guessLocality ( array $components ) : null | string
guessStreetName ( array $components ) : null | string
guessSubLocality ( array $components ) : null | string

Private Methods

Method Description
executeQuery ( $query ) : Geocoder\Model\AddressCollection

Method Details

__construct() public method

public __construct ( Http\Client\HttpClient $client, string $apiKey, boolean $useSsl = false, string | null $locale = null )
$client Http\Client\HttpClient An HTTP adapter.
$apiKey string An API key.
$useSsl boolean Whether to use an SSL connection (optional).
$locale string | null A locale (optional).

geocode() public method

public geocode ( $address )

getName() public method

public getName ( )

guessBestComponent() protected method

protected guessBestComponent ( array $components, array $keys ) : null | string
$components array
$keys array
return null | string

guessLocality() protected method

protected guessLocality ( array $components ) : null | string
$components array
return null | string

guessStreetName() protected method

protected guessStreetName ( array $components ) : null | string
$components array
return null | string

guessSubLocality() protected method

protected guessSubLocality ( array $components ) : null | string
$components array
return null | string

reverse() public method

public reverse ( $latitude, $longitude )