diff options
author | Struan Donald <struan@exo.org.uk> | 2018-10-11 16:38:19 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2018-11-06 09:51:49 +0000 |
commit | 24c0f11b727a154047cd14319ea97274d564bb69 (patch) | |
tree | 617b3a5eef11d79f533f5d9295e521237cfc924e | |
parent | d02a131f31effb53d9dc6e72fc57c30ae22c11ca (diff) |
[BANES] limit roadworks.org message by category
use the filter option to only display roadworks message for road related
categories
-rw-r--r-- | web/cobrands/bathnes/js.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/web/cobrands/bathnes/js.js b/web/cobrands/bathnes/js.js index 06741e10d..ba195f624 100644 --- a/web/cobrands/bathnes/js.js +++ b/web/cobrands/bathnes/js.js @@ -37,6 +37,20 @@ fixmystreet.roadworks.display_message = function(feature) { $('.change_location').after($msg); }; +fixmystreet.roadworks.filter = function() { + var category = $('select#form_category').val(), + categories = ['Damage to pavement', 'Damage to road', 'Faded road markings', 'Damaged Railing, manhole, or drain cover']; + return OpenLayers.Util.indexOf(categories, category) != -1; +}; + +fixmystreet.roadworks.category_change = function() { + if (fixmystreet.map) { + fixmystreet.roadworks.show_nearby(null, fixmystreet.map.getCenter()); + } +}; + +$(fixmystreet).on('report_new:category_change', fixmystreet.roadworks.category_change); + var org_id = '114'; var body = "Bath and North East Somerset Council"; fixmystreet.assets.add($.extend(true, {}, fixmystreet.roadworks.layer_future, { |