diff options
author | Struan Donald <struan@exo.org.uk> | 2011-06-09 08:53:45 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-06-09 08:53:45 +0100 |
commit | 79edaacb35d12c0f7867aab899e016805e99268b (patch) | |
tree | 2e38a01d88e57445e06c8697cef742fab7b173d4 /perllib/FixMyStreet/App/Controller/Around.pm | |
parent | a7fb8b236afb7f7f25008acdafdc5b0585e78b74 (diff) | |
parent | ba0bd42476b93908529f63bb8b71135ebf7a86ca (diff) |
Merge branch 'migrate_to_catalyst' of ssh://git.mysociety.org/data/git/public/fixmystreet into migrate_to_catalyst
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Around.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Around.pm | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index 1e06beef1..370fe7b89 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -182,13 +182,17 @@ sub display_location : Private { # create a list of all the pins 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; + @pins = map { + # Here we might have a DB::Problem or a DB::Nearby, we always want the problem. + my $p = (ref $_ eq 'FixMyStreet::App::Model::DB::Nearby') ? $_->problem : $_; + { + latitude => $p->latitude, + longitude => $p->longitude, + colour => $p->state eq 'fixed' ? 'green' : 'red', + id => $p->id, + title => $p->title, + } + } @$on_map_all, @$around_map; } { # FIXME - ideally this indented code should be in the templates |