aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm13
-rw-r--r--perllib/FixMyStreet/Cobrand/EastSussex.pm4
-rw-r--r--perllib/FixMyStreet/Geocode.pm2
3 files changed, 18 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index 8eb637879..779c0a7a2 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -862,6 +862,19 @@ Perform any extra validation on the contact form.
sub extra_contact_validation { (); }
+
+=head2 get_geocoder
+
+Return the default geocoder from config.
+
+=cut
+
+sub get_geocoder {
+ my ($self, $c) = @_;
+ return $c->config->{GEOCODER};
+}
+
+
sub problem_as_hashref {
my $self = shift;
my $problem = shift;
diff --git a/perllib/FixMyStreet/Cobrand/EastSussex.pm b/perllib/FixMyStreet/Cobrand/EastSussex.pm
index 94b404bc3..c039b8410 100644
--- a/perllib/FixMyStreet/Cobrand/EastSussex.pm
+++ b/perllib/FixMyStreet/Cobrand/EastSussex.pm
@@ -106,5 +106,9 @@ sub temp_update_potholes_contact {
$contact->update({ extra => $fields });
}
+sub get_geocoder {
+ return 'OSM'; # default of Bing gives poor results, let's try overriding.
+}
+
1;
diff --git a/perllib/FixMyStreet/Geocode.pm b/perllib/FixMyStreet/Geocode.pm
index 61c398985..2a318ea5a 100644
--- a/perllib/FixMyStreet/Geocode.pm
+++ b/perllib/FixMyStreet/Geocode.pm
@@ -35,7 +35,7 @@ sub lookup {
sub string {
my ($s, $c) = @_;
- my $service = $c->config->{GEOCODER};
+ my $service = $c->cobrand->get_geocoder($c);
$service = $service->{type} if ref $service;
$service = 'OSM' unless $service =~ /^(Bing|Google|OSM|Zurich)$/;
$service = 'OSM' if $service eq 'Bing' && !FixMyStreet->config('BING_MAPS_API_KEY');