aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Page.pm
diff options
context:
space:
mode:
authormatthew <matthew>2009-02-16 18:56:44 +0000
committermatthew <matthew>2009-02-16 18:56:44 +0000
commit883e8f1bb2843f598655b72c46023212c1c3266e (patch)
treea1c4b804b0c85b3f550a2f25c87ce0ac94f6decc /perllib/Page.pm
parent86ce66eb9094269ef04b9adb684697a445a30f61 (diff)
Factor out en-gb push/pop.
Diffstat (limited to 'perllib/Page.pm')
-rw-r--r--perllib/Page.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/perllib/Page.pm b/perllib/Page.pm
index 88eb9a754..abc136d08 100644
--- a/perllib/Page.pm
+++ b/perllib/Page.pm
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: Page.pm,v 1.139 2009-02-14 11:30:49 matthew Exp $
+# $Id: Page.pm,v 1.140 2009-02-16 18:56:44 matthew Exp $
#
package Page;
@@ -397,10 +397,11 @@ sub map_pins {
$pins .= Page::display_pin($q, $px, $py, $col);
}
- mySociety::Locale::push('en-gb');
- my ($lat, $lon) = mySociety::GeoUtil::national_grid_to_wgs84($mid_e, $mid_n, 'G');
- my $dist = mySociety::Gaze::get_radius_containing_population($lat, $lon, 200000);
- mySociety::Locale::pop();
+ my $dist;
+ mySociety::Locale::in_gb_locale {
+ my ($lat, $lon) = mySociety::GeoUtil::national_grid_to_wgs84($mid_e, $mid_n, 'G');
+ $dist = mySociety::Gaze::get_radius_containing_population($lat, $lon, 200000);
+ };
$dist = int($dist*10+0.5)/10;
my $limit = 20; # - @$current_map;