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