Przeglądaj źródła

Merge branch 'develop'

develop
Fabien Normand 2 lat temu
rodzic
commit
9b8305ebe4
2 zmienionych plików z 20 dodań i 10 usunięć
  1. +11
    -10
      Component/CitiesComponent.php
  2. +9
    -0
      Resources/assets/functions/tools.js

+ 11
- 10
Component/CitiesComponent.php Wyświetl plik

@@ -85,19 +85,20 @@ class CitiesComponent

public function callAddressApi($query)
{
if(is_null($query)) {
$query = '';
}
$resultsToReturn = [];

if(!is_null($query)) {
$provider = $this->getGeocoderProvider() ;
$query = GeocodeQuery::create($query)->withData('type', 'housenumber');
$results = $provider->geocodeQuery($query);

$provider = $this->getGeocoderProvider() ;
$query = GeocodeQuery::create($query)->withData('type', 'housenumber');
$results = $provider->geocodeQuery($query);
$resultsToReturn = array();
foreach($results as $result) {
if ($result->getStreetNumber() && strlen($result->getStreetNumber()) > 0) {
$resultsToReturn[] = $result;
foreach($results as $result) {
if ($result->getStreetNumber() && strlen($result->getStreetNumber()) > 0) {
$resultsToReturn[] = $result;
}
}
}

return $resultsToReturn;
}


+ 9
- 0
Resources/assets/functions/tools.js Wyświetl plik

@@ -65,6 +65,15 @@ export class SovTools {
else return null;
}

static formatNumberWithoutRounding(number, toFixed) {
if (number){
let factor = Math.pow(10, toFixed);
return Math.floor(number * factor) / factor
}else{
return null
}
}

static formatNumberWithoutFixed(number) {
if (typeof number == 'string') number = number.replace(',', '.');
if (number) return Number(number);

Ładowanie…
Anuluj
Zapisz