File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -290,6 +290,25 @@ app('geocoder')->geocode('8.8.8.8')->get();
290290app('geocoder')->reverse(43.882587,-103.454067)->get();
291291```
292292
293+ #### Localizing Results
294+ Use the ` locale() ` method to request localized formatting from providers that
295+ support it (GoogleMaps, Nominatim, etc.). Results are cached separately per
296+ locale, so switching locales doesn't pollute each other's cache entries:
297+ ``` php
298+ app('geocoder')->locale('it')->geocode('Bologna')->get();
299+ app('geocoder')->locale('fr')->reverse(45.5, -73.5)->get();
300+ ```
301+
302+ If you need to build a query with additional options, you can also set the
303+ locale directly on a query and pass it through ` geocodeQuery() ` or
304+ ` reverseQuery() ` :
305+ ``` php
306+ use Geocoder\Query\GeocodeQuery;
307+
308+ $query = GeocodeQuery::create('Bologna')->withLocale('it');
309+ app('geocoder')->geocodeQuery($query)->get();
310+ ```
311+
293312#### Dumping Results
294313``` php
295314app('geocoder')->geocode('Los Angeles, CA')->dump('kml');
You can’t perform that action at this time.
0 commit comments