egeocoder The almost missing Geocoder PHP library as Yii component.

  1. Installation and configuration
  2. Usage example
  3. Resources

The almost missing Geocoder PHP library as Yii component. This extension main goal is provide the easiest way to geocode something.

Installation and configuration

Install Geocoder via composer.

Copy component to extensions/EGeocoder directory located inside your application and add it to the application configuration the following way:

return array(
...
	'components' => array(
		...
		'geocoder' => array(
			'class' => 'ext.EGeocoder.EGeocoder',
			// 'httpAdapter' => 'Socket',
			'providers' => array(
                new \Geocoder\Provider\FreeGeoIpProvider(new \Geocoder\HttpAdapter\CurlHttpAdapter()),
                'GeoPlugin',
                array(
                    'name' => 'IpInfoDb',
                    // Please use your own api key
                    'apiKey' => 'fe469eea906d1be01894ef2a7dd7a1d64fb9f412ab5ebdcxx2576c7af9ac04a014',
                ),
            ),
		),
		...
	),
...
);

Usage example

$result = Yii::app()->geocoder->geocode('74.125.235.39');
$dumper = new \Geocoder\Dumper\GeoJsonDumper();
echo $dumper->dump($result);

Resources

2 0
12 followers
376 downloads
Yii Version: 1.1
License: MIT
Category: Web Service
Developed by: nk913
Created on: Apr 1, 2013
Last updated: 11 years ago

Downloads

show all

Related Extensions