diff options
author | Matthew Somerville <matthew@balti.ukcod.org.uk> | 2010-11-23 15:55:17 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@balti.ukcod.org.uk> | 2010-11-23 16:54:56 +0000 |
commit | 8690e19d0fb7cc88f8e13a3f6cc46681c1ee95a4 (patch) | |
tree | 8d385abe7d09be04ffe6842ddffcba853840730e /web/alert.cgi | |
parent | d58a65d096223ec4e4cd09d734dc3e758a8484b3 (diff) |
Have FixMyStreet::Geocode only deal in real co-ordinates.
Diffstat (limited to 'web/alert.cgi')
-rwxr-xr-x | web/alert.cgi | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/web/alert.cgi b/web/alert.cgi index 70b9d1873..3dc52c677 100755 --- a/web/alert.cgi +++ b/web/alert.cgi @@ -72,20 +72,17 @@ Page::do_fastcgi(\&main); sub alert_list { my ($q, @errors) = @_; - my @vars = qw(pc rznvy x y); + my @vars = qw(pc rznvy e n); my %input = map { $_ => scalar $q->param($_) } @vars; my %input_h = map { $_ => $q->param($_) ? ent($q->param($_)) : '' } @vars; my($error, $e, $n); - my $x = $input{x}; my $y = $input{y}; - $x ||= 0; $x += 0; - $y ||= 0; $y += 0; - if ($x || $y) { - $e = FixMyStreet::Map::tile_to_os($input{x}); - $n = FixMyStreet::Map::tile_to_os($input{y}); + if ($input{e} || $input{n}) { + $e = $input{e}; + $n = $input{n}; } else { try { - ($x, $y, $e, $n, $error) = FixMyStreet::Geocode::lookup($input{pc}, $q); + ($e, $n, $error) = FixMyStreet::Geocode::lookup($input{pc}, $q); } catch Error::Simple with { $error = shift; }; @@ -274,8 +271,8 @@ EOF rss_feed_5k => $rss_feed_5k, rss_feed_10k => $rss_feed_10k, rss_feed_20k => $rss_feed_20k, - x => $x, - y => $y, + e => $e, + n => $n, options => $options ); my $cobrand_page = Page::template_include('alert-options', $q, Page::template_root($q), %vars); $out = $cobrand_page if ($cobrand_page); |