aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Map.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2019-02-25 15:16:13 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2019-02-25 15:16:13 +0000
commit777a1b20b93b3b00030925faa682d84fc668ee0c (patch)
tree59497fb3c627d6755a4df73228c9f56409297c2a /perllib/FixMyStreet/Map.pm
parentaa7dc8b25d8d267752e7654868ec5f4bf4e7565e (diff)
parentfa50dc502b2049b331cf7ddf27c536b4100c3129 (diff)
Merge remote-tracking branch 'origin/issues/commercial/1229-duplicate-reporting'
Diffstat (limited to 'perllib/FixMyStreet/Map.pm')
-rw-r--r--perllib/FixMyStreet/Map.pm17
1 files changed, 6 insertions, 11 deletions
diff --git a/perllib/FixMyStreet/Map.pm b/perllib/FixMyStreet/Map.pm
index 8ed0c4b37..8b8cfe82c 100644
--- a/perllib/FixMyStreet/Map.pm
+++ b/perllib/FixMyStreet/Map.pm
@@ -104,26 +104,21 @@ sub map_features {
# if show_old_reports is on then there must be old reports
$c->stash->{num_old_reports} = 1;
} else {
- $p{report_age} = undef;
- $p{page} = 1;
- my $older = $c->cobrand->problems_on_map->around_map( $c, %p );
+ my $older = $c->cobrand->problems_on_map->around_map( $c, %p, report_age => undef, page => 1 );
$c->stash->{num_old_reports} = $older->pager->total_entries - $pager->total_entries;
}
- my $dist = FixMyStreet::Gaze::get_radius_containing_population( $p{latitude}, $p{longitude} );
-
# if there are fewer entries than our paging limit on the map then
# also return nearby entries for display
my $nearby;
if (@$on_map < $pager->entries_per_page && $pager->current_page == 1) {
- my $limit = 20;
- my @ids = map { $_->id } @$on_map;
- $nearby = $c->model('DB::Nearby')->nearby(
- $c, $dist, \@ids, $limit, @p{"latitude", "longitude", "categories", "states", "extra"}, $report_age
- );
+ $p{limit} = 20;
+ $p{ids} = [ map { $_->id } @$on_map ];
+ $p{distance} = FixMyStreet::Gaze::get_radius_containing_population( $p{latitude}, $p{longitude} );
+ $nearby = $c->model('DB::Nearby')->nearby($c, %p);
}
- return ( $on_map, $nearby, $dist );
+ return ( $on_map, $nearby );
}
sub click_to_wgs84 {