diff options
author | Struan Donald <struan@exo.org.uk> | 2012-07-26 18:41:27 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-08-09 09:58:36 +0100 |
commit | ee5aa052f4b8b1baf36d4237ecccd2e774b37c10 (patch) | |
tree | 5da09633c9cf1ea111be70ad873a2bb932d3ace6 | |
parent | b853eaf2783217e7790668a75af1102e1ae333dd (diff) |
adjust the initial display of the map on all reports page so there's
less jumping about on Internet Explorer
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Reports.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Bromley.pm | 13 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 10 |
3 files changed, 25 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm index 60d6d05a9..d5ccb7f3d 100644 --- a/perllib/FixMyStreet/App/Controller/Reports.pm +++ b/perllib/FixMyStreet/App/Controller/Reports.pm @@ -129,6 +129,8 @@ sub ward : Path : Args(2) { any_zoom => 1, ); + $c->cobrand->tweak_all_reports_map( $c ); + # List of wards unless ($c->stash->{ward}) { my $children = mySociety::MaPit::call('area/children', [ $c->stash->{council}->{id} ], diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm index 1d32784db..026a56feb 100644 --- a/perllib/FixMyStreet/Cobrand/Bromley.pm +++ b/perllib/FixMyStreet/Cobrand/Bromley.pm @@ -88,5 +88,18 @@ sub contact_name { 'Bromley Council (do not reply)'; } sub reports_per_page { return 20; } +sub tweak_all_reports_map { + my $self = shift; + my $c = shift; + + if ( !$c->stash->{ward} ) { + $c->stash->{map}->{longitude} = 0.040622967881348; + $c->stash->{map}->{latitude} = 51.36690161822; + $c->stash->{map}->{any_zoom} = 0; + $c->stash->{map}->{zoom} = 11; + } +} + + 1; diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index 569f25a74..ee8a2bf5e 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -783,5 +783,15 @@ sub pin_colour { return $p->is_fixed ? 'green' : 'red'; } +=head2 tweak_all_reports_map + +Used to tweak the display settings of the map on the all reports pages. + +Used in some cobrands to improve the intial display for Internet Explorer. + +=cut + +sub tweak_all_reports_map {} + 1; |