Commit 5bf21077 by Damien Moulard

fix geocoder button not working

parent ae24d0f7
......@@ -596,7 +596,7 @@ class IndexController extends AbstractController
try {
// GEOCODING ADDRESS :
$httpClient = new \Http\Adapter\Guzzle6\Client();
$provider = Nominatim::withOpenStreetMapServer($httpClient, 'Mozilla/5.0');
$provider = Nominatim::withOpenStreetMapServer($httpClient, 'Kohinos_SSA/2.4.5 (contact@caisse-alimentaire-commune.fr)');
$geocoder = new \Geocoder\StatefulGeocoder($provider, 'fr');
// Query geocoding from complete address
$result = $geocoder->geocodeQuery(GeocodeQuery::create($request->get('adresse') . ' ' . $request->get('cpostal') . ' ' . $request->get('ville')));
......
......@@ -40,7 +40,7 @@ class GeolocListener
if (empty($entity->getLat()) && empty($entity->getLon())) {
// GEOCODING ADDRESS :
$httpClient = new \Http\Adapter\Guzzle6\Client();
$provider = Nominatim::withOpenStreetMapServer($httpClient, 'Mozilla/5.0');
$provider = Nominatim::withOpenStreetMapServer($httpClient, 'Kohinos_SSA/2.4.5 (contact@caisse-alimentaire-commune.fr)');
$geocoder = new \Geocoder\StatefulGeocoder($provider, 'fr');
$fullAddress = $entity->getAdresse() . ' ' . $entity->getCpostal() . ' ' . $entity->getVille();
// Query geocoding from complete address
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment