Skip to content

Commit

Permalink
Try harder to set lng
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed May 7, 2024
1 parent 12b2680 commit 03345da
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Geo/Coder/List.pm
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,9 @@ sub geocode {
print 'Number of matches from ', ref($geocoder), ': ', scalar(@rc), "\n" if($self->{'debug'});
print Data::Dumper->new([\@rc])->Dump() if($self->{'debug'} >= 2);
if(defined($rc[0])) { # check it's not an empty hash
if(defined($rc[0]->{'long'}) && !defined($rc[0]->{'lng'})) {
$rc[0]->{'lng'} = $rc[0]->{'long'};
}
if((!defined($rc[0]->{lat})) || (!defined($rc[0]->{lng}))) {
# ::diag(Data::Dumper->new([\@rc])->Dump());
warn Data::Dumper->new([\@rc])->Dump();
Expand Down

0 comments on commit 03345da

Please sign in to comment.