aboutsummaryrefslogtreecommitdiffstats
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
parentb5ccc686b8f70a7c1bf2940c3354e732146e4bd3 (diff)
Use Gaze distance if already fetched.
-rw-r--r--perllib/FixMyStreet/App/Controller/Around.pm6
-rw-r--r--perllib/FixMyStreet/Map/OSM.pm3
2 files changed, 5 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm
index b29415566..c93ca7334 100644
--- a/perllib/FixMyStreet/App/Controller/Around.pm
+++ b/perllib/FixMyStreet/App/Controller/Around.pm
@@ -172,7 +172,7 @@ sub display_location : Private {
# get the map features
my ( $on_map_all, $on_map, $around_map, $distance ) =
- FixMyStreet::Map::map_features( $c, $latitude, $longitude,
+ FixMyStreet::Map::map_features( $c, $short_latitude, $short_longitude,
$interval );
# copy the found reports to the stash
@@ -199,8 +199,8 @@ sub display_location : Private {
$c->stash->{page} = 'around'; # So the map knows to make clickable pins, update on pan
FixMyStreet::Map::display_map(
$c,
- latitude => $latitude,
- longitude => $longitude,
+ latitude => $short_latitude,
+ longitude => $short_longitude,
clickable => 1,
pins => \@pins,
);
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;