diff options
Diffstat (limited to 'web')
-rwxr-xr-x | web/ajax.cgi | 2 | ||||
-rwxr-xr-x | web/index.cgi | 12 | ||||
-rw-r--r-- | web/js.js | 8 | ||||
-rwxr-xr-x | web/rss.cgi | 10 |
4 files changed, 16 insertions, 16 deletions
diff --git a/web/ajax.cgi b/web/ajax.cgi index 1b3ff5cf8..fff437846 100755 --- a/web/ajax.cgi +++ b/web/ajax.cgi @@ -19,7 +19,7 @@ sub main { my %input = map { $_ => $q->param($_) || '' } @vars; my %input_h = map { $_ => $q->param($_) ? ent($q->param($_)) : '' } @vars; - # Our current X/Y bottom left of visible map + # Our current X/Y middle of visible map my $x = $input{x}; my $y = $input{y}; $x ||= 0; $x += 0; diff --git a/web/index.cgi b/web/index.cgi index f9428efa3..9df86adc2 100755 --- a/web/index.cgi +++ b/web/index.cgi @@ -478,8 +478,8 @@ sub display_form { # Map was clicked on $pin_x = Page::click_to_tile($pin_tile_x, $pin_x); $pin_y = Page::click_to_tile($pin_tile_y, $pin_y, 1); - $input{x} ||= int($pin_x) - 1; - $input{y} ||= int($pin_y) - 1; + $input{x} ||= int($pin_x); + $input{y} ||= int($pin_y); $px = Page::tile_to_px($pin_x, $input{x}); $py = Page::tile_to_px($pin_y, $input{y}, 1); $easting = Page::tile_to_os($pin_x); @@ -927,12 +927,12 @@ sub display_problem { my ($x, $y, $x_tile, $y_tile, $px, $py) = Page::os_to_px_with_adjust($q, $problem->{easting}, $problem->{northing}, $input{x}, $input{y}); # Try and have pin near centre of map - if (!$input{x} && $x - $x_tile < 0.5) { - $x_tile -= 1; + if (!$input{x} && $x - $x_tile > 0.5) { + $x_tile += 1; $px = Page::os_to_px($problem->{easting}, $x_tile); } - if (!$input{y} && $y - $y_tile < 0.5) { - $y_tile -= 1; + if (!$input{y} && $y - $y_tile > 0.5) { + $y_tile += 1; $py = Page::os_to_px($problem->{northing}, $y_tile, 1); } @@ -57,8 +57,8 @@ YAHOO.util.Event.onContentReady('mapForm', function() { this.onsubmit = function() { return false; }; } - this.x.value = fixmystreet.x + 2; - this.y.value = fixmystreet.y + 2; + this.x.value = fixmystreet.x + 3; + this.y.value = fixmystreet.y + 3; /* if (swfu && swfu.getStats().files_queued > 0) { swfu.startUpload(); @@ -309,8 +309,8 @@ function load_pins(x, y) { } var ajax_params = [ 'sx=' + document.getElementById('formX').value, 'sy=' + document.getElementById('formY').value, - 'x=' + (x+2), - 'y=' + (y+2), + 'x=' + (x+3), + 'y=' + (y+3), 'all_pins=' + all_pins ]; if (document.getElementById('extra_param')) { diff --git a/web/rss.cgi b/web/rss.cgi index 7060d1709..44bb24be7 100755 --- a/web/rss.cgi +++ b/web/rss.cgi @@ -25,13 +25,13 @@ sub main { my $out; if ($type eq 'local_problems') { $out = rss_local_problems($q); - return unless $out; + return unless $out; } elsif ($type eq 'new_updates') { my $id = $q->param('id'); my $problem = Problems::fetch_problem($id); if (!$problem) { - print $q->header(-status=>'404 Not Found',-type=>'text/html'); - return; + print $q->header(-status=>'404 Not Found',-type=>'text/html'); + return; } my $qs = 'report/' . $id; $out = mySociety::Alert::generate_rss($type, $xsl, $qs, [$id], undef, $cobrand, $q); @@ -72,8 +72,8 @@ sub rss_local_problems { ($e, $n) = mySociety::GeoUtil::wgs84_to_national_grid($lat, $lon, 'G'); $x = int(Page::os_to_tile($e)); $y = int(Page::os_to_tile($n)); - print $q->redirect(-location => "$base/rss/$x/$y"); - return ''; + print $q->redirect(-location => "$base/rss/$x/$y"); + return ''; } elsif ($x && $y) { $e = Page::tile_to_os($x); $n = Page::tile_to_os($y); |