Skip to content

Commit

Permalink
Test fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
edwh committed Mar 31, 2023
1 parent 0074365 commit 3e58310
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/Helpers/Geocoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ class Geocoder
public function geocode($location)
{
if ($location != 'ForceGeocodeFailure') {
$geocodeResponse = app('geocoder')->geocodeQuery(GeocodeQuery::create($location)->withData('location_type', Mapbox::TYPE_PLACE));
$geocodeResponse = app('geocoder')->geocodeQuery(GeocodeQuery::create($location)->withData('location_type', [ Mapbox::TYPE_PLACE, Mapbox::TYPE_ADDRESS ]));
$addressCollection = $geocodeResponse->get();
$address = $addressCollection->get(0);
if ($address) {
echo "Geocoded $location to ".$address->getCoordinates()->getLatitude().','.$address->getCoordinates()->getLongitude()."\n";
return [
'latitude' => $address->getCoordinates()->getLatitude(),
'longitude' => $address->getCoordinates()->getLongitude(),
Expand Down

0 comments on commit 3e58310

Please sign in to comment.