aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Integrations/ExorRDI.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2017-12-22 12:53:48 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-05-09 12:57:56 +0100
commit22f0fed0b1ce6e7effac37e025bd55dc6043a838 (patch)
treea4bd66224c560418863319e9a6144d9b8702d462 /perllib/FixMyStreet/Integrations/ExorRDI.pm
parent22815e994510659870987609d244b3f6324bab22 (diff)
ajax endpoint to return closest address.
/ajax/closest will return ajax with details of the closest address to the lat/lon passed in from the Bing geocoder. Tidy up find_closest() to use overloaded string rather than passing in whether you want a string or not.
Diffstat (limited to 'perllib/FixMyStreet/Integrations/ExorRDI.pm')
-rw-r--r--perllib/FixMyStreet/Integrations/ExorRDI.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Integrations/ExorRDI.pm b/perllib/FixMyStreet/Integrations/ExorRDI.pm
index dc865e1ad..ce59df9be 100644
--- a/perllib/FixMyStreet/Integrations/ExorRDI.pm
+++ b/perllib/FixMyStreet/Integrations/ExorRDI.pm
@@ -113,9 +113,9 @@ sub construct {
my $location = "${eastings}E ${northings}N";
$location = "[DID NOT USE MAP] $location" unless $report->used_map;
- my $closest_address = $cobrand->find_closest($report, 1);
+ my $closest_address = $cobrand->find_closest($report);
if (%$closest_address) {
- $location .= " Nearest road: $closest_address->{road}." if $closest_address->{road};
+ $location .= " Nearest road: $closest_address->{name}." if $closest_address->{name};
$location .= " Nearest postcode: $closest_address->{postcode}{postcode}." if $closest_address->{postcode};
}