Yii 1.1: dgapiclient

The DGApiClient is a Yii Framework plugin that supply methods allowing you easily communicate with 2GIS API
2 followers

DGApiClient Extension

DoubleGIS company presents Yii extensions. The DGApiClient is plugin that supply methods allowing you easily communicate with 2GIS API. Contains all methods described on http://api.2gis.ru/doc/main.

Requirements

Installation

'components' => array(
        ...
        'apiClient' => array(
           'class' => 'application.components.DGApiClient.DGApiClient',
           'apiKey' => 'YOUR_PERSONAL_KEY_HERE',
           'webBrowser' => 'webBrowser', // component name
        ),
        'webBrowser' => array( // DGWebBrowser 
           'class' => 'application.components.DGWebBrowser.DGWebBrowser',
           'adapter' => 'curl',
        ),
        ...
  • Enjoy!

Usage:

$apiClient = Yii::app()->getComponent('apiClient');

E.g. to recieve limited (to 10 records) list of geo-objects in radius one kilometer away from the point (82.901886, 54.991984) in XML format:

$list = $apiClient->geoSearch(array(
    'q'         => '82.901886,54.991984',
    'radius'    => 1000,
    'limit'     => 10,
    'output'    => 'xml'
   ));

For detailed description of methods and their parameters see http://api.2gis.ru/doc/main/

Changelog:

  • 1.1 Fix bug with method project/list
  • 1.0 Initial release

Be the first person to leave a comment

Please to leave your comment.

Create extension