aboutsummaryrefslogtreecommitdiffstats
path: root/web/index.cgi
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@fury.ukcod.org.uk>2011-02-26 02:00:00 +0000
committerMatthew Somerville <matthew@fury.ukcod.org.uk>2011-02-26 02:00:00 +0000
commitfe72a8ec3d195ec2b88bf902ec4bbff1c9693f86 (patch)
treea2af1ab4b6fe14bc87d1f19f675964507501aba9 /web/index.cgi
parentd0bcc4d1d639b7ae806e8719727d3494a6229db1 (diff)
Move compass function to Tilma code, pass Q through to click->latlon lookup.
Diffstat (limited to 'web/index.cgi')
-rwxr-xr-xweb/index.cgi12
1 files changed, 8 insertions, 4 deletions
diff --git a/web/index.cgi b/web/index.cgi
index ed5b285c2..e801e076b 100755
--- a/web/index.cgi
+++ b/web/index.cgi
@@ -500,8 +500,12 @@ sub display_form {
$longitude = $lon;
}
} elsif ($pin_x && $pin_y) {
- # tilma map was clicked on
- ($latitude, $longitude) = FixMyStreet::Map::click_to_wgs84($pin_tile_x, $pin_x, $pin_tile_y, $pin_y);
+
+ # Map was clicked on (tilma, or non-JS OpenLayers, for example)
+ ($latitude, $longitude) = FixMyStreet::Map::click_to_wgs84($q, $pin_tile_x, $pin_x, $pin_tile_y, $pin_y);
+ # Shrink, as don't need accuracy plus we want them as English strings
+ ($latitude, $longitude) = map { Utils::truncate_coordinate($_) } ( $latitude, $longitude );
+
} elsif ( $input{partial} && $input{pc} && !length $input{latitude} && !length $input{longitude} ) {
my $error;
try {
@@ -719,8 +723,8 @@ photo of the problem if you have one), etc.'));
}
$vars{text_help} .= '
-<input type="hidden" name="latitude" value="' . $latitude . '">
-<input type="hidden" name="longitude" value="' . $longitude . '">';
+<input type="hidden" name="latitude" id="fixmystreet.latitude" value="' . $latitude . '">
+<input type="hidden" name="longitude" id="fixmystreet.longitude" value="' . $longitude . '">';
if (@errors) {
$vars{errors} = '<ul class="error"><li>' . join('</li><li>', @errors) . '</li></ul>';