aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Map
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-08-11 15:55:55 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-08-11 15:55:55 +0100
commit4cb6f56c9eb6f42db1086beb13ecd5e5698126ba (patch)
treefb83a337f34225297fd4db4e7aff655038293b3e /perllib/FixMyStreet/Map
parentb5ccc686b8f70a7c1bf2940c3354e732146e4bd3 (diff)
Use Gaze distance if already fetched.
Diffstat (limited to 'perllib/FixMyStreet/Map')
-rw-r--r--perllib/FixMyStreet/Map/OSM.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Map/OSM.pm b/perllib/FixMyStreet/Map/OSM.pm
index 05dc6ad39..c848c9e5e 100644
--- a/perllib/FixMyStreet/Map/OSM.pm
+++ b/perllib/FixMyStreet/Map/OSM.pm
@@ -59,7 +59,8 @@ sub display_map {
}
# Adjust zoom level dependent upon population density
- my $dist = mySociety::Gaze::get_radius_containing_population( $params{latitude}, $params{longitude}, 200_000 );
+ my $dist = $c->stash->{distance}
+ || mySociety::Gaze::get_radius_containing_population( $params{latitude}, $params{longitude}, 200_000 );
my $default_zoom = $numZoomLevels - 3;
$default_zoom = $numZoomLevels - 2 if $dist < 10;