diff options
author | Struan Donald <struan@exo.org.uk> | 2018-10-11 17:30:20 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2018-11-06 09:51:49 +0000 |
commit | 0cbbf0f2e23069deddc9dbfc836bfdf9e4442c54 (patch) | |
tree | 40e528e9de0e49d33174bf8b2572d82c32f0aeb0 /web | |
parent | 24c0f11b727a154047cd14319ea97274d564bb69 (diff) |
[BANES] filter roadworks messages on type
use symbol code to limit the types of roadworks that show.
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/bathnes/js.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/web/cobrands/bathnes/js.js b/web/cobrands/bathnes/js.js index ba195f624..a478d71fc 100644 --- a/web/cobrands/bathnes/js.js +++ b/web/cobrands/bathnes/js.js @@ -37,10 +37,17 @@ fixmystreet.roadworks.display_message = function(feature) { $('.change_location').after($msg); }; -fixmystreet.roadworks.filter = function() { +fixmystreet.roadworks.filter = function(feature) { var category = $('select#form_category').val(), + parts = feature.attributes.symbol.split(''), + valid_types = ['h', 'n', 'l', 'w'], + valid_subtypes = ['15', '25'], + type = parts[2], + sub_type = parts[4] + parts[5], categories = ['Damage to pavement', 'Damage to road', 'Faded road markings', 'Damaged Railing, manhole, or drain cover']; - return OpenLayers.Util.indexOf(categories, category) != -1; + return OpenLayers.Util.indexOf(categories, category) != -1 && + ( OpenLayers.Util.indexOf(valid_types, type) != -1 || + ( type === 'o' && OpenLayers.Util.indexOf(valid_subtypes, sub_type) != -1 ) ); }; fixmystreet.roadworks.category_change = function() { |