diff options
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Stevenage.pm | 38 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/OSM.pm | 2 |
4 files changed, 42 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 09149ae14..dedd447ee 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -883,7 +883,7 @@ sub process_report : Private { $c->cobrand->process_extras( $c, $contacts[0]->area_id, \@extra ); if ( @extra ) { - $c->stash->{report_meta} = \@extra; + $c->stash->{report_meta} = { map { $_->{name} => $_ } @extra }; $report->extra( \@extra ); } } elsif ( @{ $c->stash->{area_ids_to_list} } ) { diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index a6c9c6fba..6324030b8 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -726,5 +726,7 @@ sub tweak_all_reports_map {} sub can_support_problems { return 0; } +sub default_map_zoom { undef }; + 1; diff --git a/perllib/FixMyStreet/Cobrand/Stevenage.pm b/perllib/FixMyStreet/Cobrand/Stevenage.pm new file mode 100644 index 000000000..5f6ac81e8 --- /dev/null +++ b/perllib/FixMyStreet/Cobrand/Stevenage.pm @@ -0,0 +1,38 @@ +package FixMyStreet::Cobrand::Stevenage; +use parent 'FixMyStreet::Cobrand::UKCouncils'; + +use strict; +use warnings; + +sub council_id { return 2347; } +sub council_area { return 'Stevenage'; } +sub council_name { return 'Stevenage Council'; } +sub council_url { return 'stevenage'; } + +sub path_to_web_templates { + my $self = shift; + return [ + FixMyStreet->path_to( 'templates/web', $self->moniker )->stringify, + FixMyStreet->path_to( 'templates/web/fixmystreet' )->stringify + ]; +} + +sub disambiguate_location { + my $self = shift; + return { + %{ $self->SUPER::disambiguate_location() }, + town => 'Stevenage', + centre => '51.904330,-0.189364', + span => '0.063112,0.087585', + bounds => [ 51.869319, -0.234382, 51.932431, -0.146796 ], + }; +} + +sub example_places { + return [ 'SG1 1HN', 'Lyton Way' ]; +} + +sub default_map_zoom { return 3; } + +1; + diff --git a/perllib/FixMyStreet/Map/OSM.pm b/perllib/FixMyStreet/Map/OSM.pm index 693f42e4f..6b3bebba2 100644 --- a/perllib/FixMyStreet/Map/OSM.pm +++ b/perllib/FixMyStreet/Map/OSM.pm @@ -62,7 +62,7 @@ sub display_map { # Adjust zoom level dependent upon population density my $dist = $c->stash->{distance} || mySociety::Gaze::get_radius_containing_population( $params{latitude}, $params{longitude}, 200_000 ); - my $default_zoom = $numZoomLevels - 3; + my $default_zoom = $c->cobrand->default_map_zoom() ? $c->cobrand->default_map_zoom() : $numZoomLevels - 3; $default_zoom = $numZoomLevels - 2 if $dist < 10; # Map centre may be overridden in the query string |