PHP code example of demollc / sputnik-provider
1. Go to this page and download the library: Download demollc/sputnik-provider library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
demollc / sputnik-provider example snippets
use Geocoder\Query\GeocodeQuery;
use Geocoder\Query\ReverseQuery;
$httpClient = new \Http\Adapter\Guzzle7\Client();
$geocoder = new \Geocoder\Provider\Sputnik\Sputnik($httpClient, null, '<your-api-key>');
$result = $geocoder->geocodeQuery(GeocodeQuery::create('ул. Генерала Лизюкова, 4, Воронеж'));
$result = $geocoder->reverseQuery(ReverseQuery::fromCoordinates(...));