diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-06-07 14:03:47 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-06-07 14:03:47 +0100 |
commit | be0166b940f99a04ad15805744dc87f6c7c605fe (patch) | |
tree | 25d4b9cc1483f815409fa2ce7a00bb2ea182b4bd | |
parent | 9eb232472c3845d195391e5412d753d7bdf0cbe6 (diff) |
Don't show any pins if no-JS no_pins parameter is supplied.
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Around.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index c554b2bb7..aed56e58f 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -180,13 +180,16 @@ sub display_location : Private { $c->stash->{distance} = $distance; # create a list of all the pins - my @pins = map { { + my @pins; + unless ($c->req->param('no_pins')) { + @pins = map { { latitude => $_->{latitude}, longitude => $_->{longitude}, colour => $_->{state} eq 'fixed' ? 'green' : 'red', id => $_->{id}, title => $_->{title}, - } } @$on_map_all, @$around_map; + } } @$on_map_all, @$around_map; + } { # FIXME - ideally this indented code should be in the templates FixMyStreet::Map::display_map( |