Skip to content

Commit 38d4960

Browse files
authored
Update README.md
1 parent e2ab558 commit 38d4960

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

README.md

+20-3
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,32 @@ This extension is available at packagist.org and can be installed via composer b
1919

2020
Configuration
2121
---------
22-
To work, you need to connect the package `glendemon/dadata-suggestions`
22+
To work, you need to connect the package `wowworks/geocoder-php-dadata-provider`
2323

2424
Example:
2525

2626
```php
2727
$service = new \DadataSuggestions\DadataSuggestionsService();
2828
$service->setUrl('https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/');
2929
$service->setToken('...');
30-
$daData = new \Wowworks\Dadata\Dadata($service);
31-
$data = $daData->geocodeQuery(\Geocoder\Query\GeocodeQuery::create('г Москва, улица Академика Королева, дом 15, корп. 2'));
30+
$dadataProvider = new \Wowworks\Dadata\Dadata($service);
31+
$collection = $dadataProvider->geocodeQuery(\Geocoder\Query\GeocodeQuery::create('г Москва, улица Академика Королева, дом 15, корп. 2'));
32+
foreach ($collection->all() as $location) {
33+
$location->getCoordinates()->getLatitude();
34+
$location->getCoordinates()->getLongitude();
35+
36+
$location->getCountry();
37+
foreach ($location->getAdminLevels() as $level) {
38+
if ($level instanceof AdminLevel) {
39+
$level->getName();
40+
}
41+
}
42+
$location->getLocality();
43+
$location->getSubLocality();
44+
$location->getStreetName();
45+
$location->getStreetNumber();
46+
$location->getProvidedBy();
47+
}
48+
3249
```
3350

0 commit comments

Comments
 (0)