diff options
author | Dave Arter <davea@mysociety.org> | 2017-11-21 11:34:29 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2018-04-10 10:42:33 +0100 |
commit | cfacd7dc51ae92f593a7001f481199ee9021b17f (patch) | |
tree | ff55c5f3385d5f93b3d5ebee4c758fc7d67e5ab0 /perllib/FixMyStreet | |
parent | 8c135e97beb5850b116275f3a76a606a9d7a705c (diff) |
[BANES] Add BathNES map type & assets
BANES have some staff-only assets, so this adds a cobrand hook
to enable extra JS to be included on the page for staff users.
- Add custom OpenLayers build with GeoJSON support
- Add grit bins/street lights/LLPG asset layers
- Displays non-BANES street light assets in grey
- Add adopted highways to map
This means USRNs will be set for reports made by members of the public.
To keep the map simple, however, the highways layer is invisible to
non-staff users.
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/BathNES.pm | 16 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/BathNES.pm | 18 |
2 files changed, 31 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/Cobrand/BathNES.pm b/perllib/FixMyStreet/Cobrand/BathNES.pm index 4200f8bd6..fbe93c1af 100644 --- a/perllib/FixMyStreet/Cobrand/BathNES.pm +++ b/perllib/FixMyStreet/Cobrand/BathNES.pm @@ -13,6 +13,7 @@ sub contact_email { my $self = shift; return join( '@', 'fixmystreet', 'bathnes.gov.uk' ); } +sub map_type { 'BathNES' } sub example_places { return ( 'BA1 1JQ', "Lansdown Grove" ); @@ -41,9 +42,7 @@ sub pin_colour { return 'yellow'; } -sub send_questionnaires { - return 0; -} +sub send_questionnaires { 0 } sub enable_category_groups { 1 } @@ -51,4 +50,15 @@ sub default_show_name { 0 } sub default_map_zoom { 3 } +sub map_js_extra { + my ($self, $c) = @_; + + return unless $c->user_exists; + + my $banes_user = $c->user->from_body && $c->user->from_body->areas->{$self->council_area_id}; + if ( $banes_user || $c->user->is_superuser ) { + return ['/cobrands/bathnes/staff.js']; + } +} + 1; diff --git a/perllib/FixMyStreet/Map/BathNES.pm b/perllib/FixMyStreet/Map/BathNES.pm new file mode 100644 index 000000000..9c9c3c11d --- /dev/null +++ b/perllib/FixMyStreet/Map/BathNES.pm @@ -0,0 +1,18 @@ +# FixMyStreet:Map::BathNES +# More JavaScript, for street assets + +package FixMyStreet::Map::BathNES; +use base 'FixMyStreet::Map::OSM'; + +use strict; + +sub map_javascript { [ + '/vendor/OpenLayers/OpenLayers.bathnes.js', + '/vendor/OpenLayers.Projection.OrdnanceSurvey.js', + '/js/map-OpenLayers.js', + '/js/map-OpenStreetMap.js', + '/cobrands/fixmystreet/assets.js', + '/cobrands/bathnes/js.js', +] } + +1;
\ No newline at end of file |