Commit 3285a19e by Julien Jorry

Fix geoloc lat lon

parent 8e7ca4e1
...@@ -303,8 +303,8 @@ class ImportController extends CRUDController ...@@ -303,8 +303,8 @@ class ImportController extends CRUDController
$geolocFound->setCpostal($cpostal); $geolocFound->setCpostal($cpostal);
$geolocFound->setVille($ville); $geolocFound->setVille($ville);
if (!empty($latitude) && !empty($longitude)) { if (!empty($latitude) && !empty($longitude)) {
$geolocFound->setLat((float) $latitude); $geolocFound->setLat(floatval(str_replace(',', '.', $latitude)));
$geolocFound->setLon((float) $longitude); $geolocFound->setLon(floatval(str_replace(',', '.', $longitude)));
} }
$comptoir->setGeoloc($geolocFound); $comptoir->setGeoloc($geolocFound);
} }
......
...@@ -39,8 +39,8 @@ class GeolocListener ...@@ -39,8 +39,8 @@ class GeolocListener
$result = $geocoder->geocodeQuery(GeocodeQuery::create($fullAddress)); $result = $geocoder->geocodeQuery(GeocodeQuery::create($fullAddress));
if (count($result) > 0) { if (count($result) > 0) {
$coords = $result->first()->getCoordinates(); $coords = $result->first()->getCoordinates();
$entity->setLat($coords->getLatitude()); $entity->setLat(floatval(str_replace(',', '.', $coords->getLatitude())));
$entity->setLon($coords->getLongitude()); $entity->setLon(floatval(str_replace(',', '.', $coords->getLongitude())));
} }
} }
} }
......
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