Pārlūkot izejas kodu

Merge branch 'develop'

develop
Fabien Normand pirms 2 gadiem
vecāks
revīzija
9b8305ebe4
2 mainītis faili ar 20 papildinājumiem un 10 dzēšanām
  1. +11
    -10
      Component/CitiesComponent.php
  2. +9
    -0
      Resources/assets/functions/tools.js

+ 11
- 10
Component/CitiesComponent.php Parādīt failu

@@ -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 Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt