File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -20,3 +20,22 @@ This is the "bpost" provider for the [Geocoder PHP](https://github.com/geocoder-
2020## Usage
2121
2222See [ Geocoder PHP README file] ( https://github.com/geocoder-php/Geocoder/blob/master/README.md ) .
23+
24+ ``` php
25+ use Geocoder\Query\GeocodeQuery;
26+
27+ $httpClient = new \Http\Adapter\Guzzle6\Client();
28+ $provider = new \Geocoder\Provider\bpost\bpost($httpClient);
29+ $geocoder = new \Geocoder\StatefulGeocoder($provider, 'en');
30+
31+ // Query with unstructured address
32+ $result = $geocoder->geocodeQuery(GeocodeQuery::create('5 Place des Palais 1000 Bruxelles'));
33+
34+ // Query with structured address
35+ $query = GeocodeQuery::create('5 Place des Palais 1000 Bruxelles')
36+ ->withData('streetNumber', '5')
37+ ->withData('streetName', 'Place des Palais')
38+ ->withData('postalCode', '1000')
39+ ->withData('locality', 'Bruxelles');
40+ $results = $geocoder->geocodeQuery($query);
41+ ```
You can’t perform that action at this time.
0 commit comments