diff options
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Location.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Location.pm | 15 |
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. |