PHP code example of wimski / nominatim-geocoding-api-client
1. Go to this page and download the library: Download wimski/nominatim-geocoding-api-client 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/ */
wimski / nominatim-geocoding-api-client example snippets
use Wimski\Nominatim\Client;
use Wimski\Nominatim\Config\NominatimConfig;
use Wimski\Nominatim\GeocoderServices\NominatimGeocoderService;
use Wimski\Nominatim\RequestParameters\ForwardGeocodingQueryRequestParameters;
use Wimski\Nominatim\Transformers\GeocodingResponseTransformer;
$config = new NominatimConfig(
'my-custom-user-agent',
'[email protected]',
);
$service = new NominatimGeocoderService(
new Client(),
new GeocodingResponseTransformer(),
$config,
);
$requestParameters = ForwardGeocodingQueryRequestParameters::make('some query')
->addCountryCode('nl')
->
$service = new NominatimGeocoderService(
new Client($myCustomPsrHttpClient),
new GeocodingResponseTransformer(),
new NominatimConfig('user-agent', '[email protected]'),
);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.