Skip to content

Commit

Permalink
Update SPW.php
Browse files Browse the repository at this point in the history
Fix error when more than one postal code or sublocality
  • Loading branch information
jbelien committed Mar 7, 2018
1 parent a076a56 commit 0703bf1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions SPW.php
Expand Up @@ -82,8 +82,8 @@ public function geocodeQuery(GeocodeQuery $query): Collection
$streetName = !empty($result->rue->nom) ? $result->rue->nom : null;
$number = !empty($result->num) ? $result->num : null;
$municipality = !empty($result->rue->commune) ? $result->rue->commune : null;
$postCode = !empty($result->rue->cps) ? (string) $result->rue->cps : null;
$subLocality = !empty($result->rue->localites) ? $result->rue->localites : null;
$postCode = !empty($result->rue->cps) ? (is_array($result->rue->cps) ? implode(', ', $result->rue->cps) : (string) $result->rue->cps) : null;
$subLocality = !empty($result->rue->localites) ? (is_array($result->rue->localites) ? implode(', ', $result->rue->localites) : $result->rue->localites) : null;
$countryCode = 'BE';

$lowerLeftSrc = new Point($result->rue->xMin, $result->rue->yMin, $proj31370);
Expand Down Expand Up @@ -142,8 +142,8 @@ public function reverseQuery(ReverseQuery $query): Collection
$streetName = !empty($result->rue->nom) ? $result->rue->nom : null;
$number = !empty($result->num) ? $result->num : null;
$municipality = !empty($result->rue->commune) ? $result->rue->commune : null;
$postCode = !empty($result->rue->cps) ? (string) $result->rue->cps : null;
$subLocality = !empty($result->rue->localites) ? $result->rue->localites : null;
$postCode = !empty($result->rue->cps) ? (is_array($result->rue->cps) ? implode(', ', $result->rue->cps) : (string) $result->rue->cps) : null;
$subLocality = !empty($result->rue->localites) ? (is_array($result->rue->localites) ? implode(', ', $result->rue->localites) : $result->rue->localites) : null;
$countryCode = 'BE';

$lowerLeftSrc = new Point($result->rue->xMin, $result->rue->yMin, $proj31370);
Expand Down

0 comments on commit 0703bf1

Please sign in to comment.