diff options
-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() { |