diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-04-08 16:55:12 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-04-08 16:55:12 +0100 |
commit | 75002bb7f3eb82fa1c8002e199e188501d7954a4 (patch) | |
tree | d9e285c6b5003663f8f400cb1f81697f6fb9f999 | |
parent | 970be3512091f60e988997b674f1aca320481f22 (diff) | |
parent | 3e437b5a5a3e27100473f095e91d8d6637f2a027 (diff) |
Merge branch 'tfl-stroke-opacity'
-rw-r--r-- | perllib/FixMyStreet/Cobrand/TfL.pm | 14 | ||||
-rw-r--r-- | t/Mock/Tilma.pm | 27 | ||||
-rw-r--r-- | web/cobrands/tfl/assets.js | 2 |
3 files changed, 34 insertions, 9 deletions
diff --git a/perllib/FixMyStreet/Cobrand/TfL.pm b/perllib/FixMyStreet/Cobrand/TfL.pm index b80929f25..8e133fa58 100644 --- a/perllib/FixMyStreet/Cobrand/TfL.pm +++ b/perllib/FixMyStreet/Cobrand/TfL.pm @@ -421,7 +421,19 @@ sub munge_reports_area_list { } sub munge_report_new_contacts { } -sub munge_report_new_bodies { } + +sub munge_report_new_bodies { + my ($self, $bodies) = @_; + + # Highways England handling + my $c = $self->{c}; + my $he = FixMyStreet::Cobrand::HighwaysEngland->new({ c => $c }); + my $on_he_road = $c->stash->{on_he_road} = $he->report_new_is_on_he_road; + + if (!$on_he_road) { + %$bodies = map { $_->id => $_ } grep { $_->name ne 'Highways England' } values %$bodies; + } +} sub munge_surrounding_london { my ($self, $bodies) = @_; diff --git a/t/Mock/Tilma.pm b/t/Mock/Tilma.pm index 5a11209e3..7542b1f5e 100644 --- a/t/Mock/Tilma.pm +++ b/t/Mock/Tilma.pm @@ -10,6 +10,18 @@ has json => ( }, ); +sub as_json { + my ($self, $features) = @_; + my $json = mySociety::Locale::in_gb_locale { + $self->json->encode({ + type => "FeatureCollection", + crs => { type => "name", properties => { name => "urn:ogc:def:crs:EPSG::27700" } }, + features => $features, + }); + }; + return $json; +} + sub dispatch_request { my $self = shift; @@ -25,15 +37,16 @@ sub dispatch_request { [ 539408.94, 170607.58 ], ] ] } } ]; } - my $json = mySociety::Locale::in_gb_locale { - $self->json->encode({ - type => "FeatureCollection", - crs => { type => "name", properties => { name => "urn:ogc:def:crs:EPSG::27700" } }, - features => $features, - }); - }; + my $json = $self->as_json($features); return [ 200, [ 'Content-Type' => 'application/json' ], [ $json ] ]; }, + + sub (GET + /mapserver/highways + ?*) { + my ($self, $args) = @_; + my $json = $self->as_json([]); + return [ 200, [ 'Content-Type' => 'application/json' ], [ $json ] ]; + }, + } __PACKAGE__->run_if_script; diff --git a/web/cobrands/tfl/assets.js b/web/cobrands/tfl/assets.js index 7538d45e1..203df578f 100644 --- a/web/cobrands/tfl/assets.js +++ b/web/cobrands/tfl/assets.js @@ -35,7 +35,7 @@ var tlrn_stylemap = new OpenLayers.StyleMap({ fillColor: "#ff0000", fillOpacity: 0.3, strokeColor: "#ff0000", - strokeOpacity: 0.6, + strokeOpacity: 1, strokeWidth: 2 }) }); |