aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Location.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-11-06 12:26:26 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-11-06 12:26:26 +0000
commit53e22391a3975b2c2a9ebca8b75fab6127c767b7 (patch)
tree8c667b07a9c07dbc0c11e2d3bb003b6da9dc6db2 /perllib/FixMyStreet/App/Controller/Location.pm
parent91bec61612a5ad0c4ee87942dae0611a9a211243 (diff)
parent27f6a53b0be0e36ffccbabd45592ee6fddf0092a (diff)
Merge branch 'around-and-about-pagination'
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Location.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Location.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Location.pm b/perllib/FixMyStreet/App/Controller/Location.pm
index cb2077ede..8d5b0b147 100644
--- a/perllib/FixMyStreet/App/Controller/Location.pm
+++ b/perllib/FixMyStreet/App/Controller/Location.pm
@@ -110,6 +110,21 @@ sub determine_location_from_pc : Private {
return;
}
+sub determine_location_from_bbox : Private {
+ my ( $self, $c ) = @_;
+
+ my $bbox = $c->get_param('bbox');
+ return unless $bbox;
+
+ my ($min_lon, $min_lat, $max_lon, $max_lat) = split /,/, $bbox;
+ my $longitude = ($max_lon + $min_lon ) / 2;
+ my $latitude = ($max_lat + $min_lat ) / 2;
+ $c->stash->{bbox} = $bbox;
+ $c->stash->{latitude} = $latitude;
+ $c->stash->{longitude} = $longitude;
+ return $c->forward('check_location');
+}
+
=head2 check_location
Just make sure that for UK installs, our co-ordinates are indeed in the UK.