Ver código fonte

Merge branch 'develop'

develop
Fabien Normand 2 anos atrás
pai
commit
9b8305ebe4
2 arquivos alterados com 20 adições e 10 exclusões
  1. +11
    -10
      Component/CitiesComponent.php
  2. +9
    -0
      Resources/assets/functions/tools.js

+ 11
- 10
Component/CitiesComponent.php Ver arquivo

@@ -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 Ver arquivo

@@ -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);

Carregando…
Cancelar
Salvar