PHP code example of geocoder-php / arcgis-online-provider
1. Go to this page and download the library: Download geocoder-php/arcgis-online-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/ */
geocoder-php / arcgis-online-provider example snippets
$httpClient = new \Http\Discovery\Psr18Client();
$provider = new \Geocoder\Provider\ArcGISList\ArcGISList($httpClient);
// Uses the `findAddressCandidates` operation. Result storage is prohibited.
$result = $geocoder->geocodeQuery(GeocodeQuery::create('Buckingham Palace, London'));
$httpClient = new \Http\Discovery\Psr18Client();
// Your token is ient, 'your-token');
// Uses the `geocodeAddresses` operation. Result storage is permitted.
$result = $geocoder->geocodeQuery(GeocodeQuery::create('Buckingham Palace, London'));