From 07be4da57ab98fc955b0c88bb0049fd886a16b92 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Tue, 27 Mar 2018 17:34:12 +0100 Subject: [Bromley] Handle clicks on TfL road layer. If a TfL road is clicked, but no asset selected, show a message that it might not be a Bromley road and set single_body_only to TfL. Otherwise hide message and set single_body_only to Bromley. --- web/cobrands/bromley/map.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/web/cobrands/bromley/map.js b/web/cobrands/bromley/map.js index 622fbeed6..35c339f69 100644 --- a/web/cobrands/bromley/map.js +++ b/web/cobrands/bromley/map.js @@ -77,7 +77,32 @@ fixmystreet.assets.add($.extend(true, {}, defaults, { stylemap: highways_stylemap, always_visible: true, asset_category: ["Blocked drains", "Faulty street light", 'Faulty street sign', 'Floral displays', 'Grass needs cutting', 'Obstructions (skips, A boards)', 'Overhanging vegetation from private land', 'Pavement defect', 'Public Tree related issue', "Road defect"], - non_interactive: true + non_interactive: true, + road: true, + actions: { + found: function(layer) { + if (fixmystreet.assets.selectedFeature()) { + $('#road-warning').remove(); + return; + } + var msg = 'The location selected is a Transport for London Red Route. TfL are responsible for the reported category and can be alerted to issues via: Street issues'; + if ( $('#road-warning').length ) { + $('#road-warning').html(msg); + } else { + $('.change_location').after('
' + msg + '
'); + } + $('#single_body_only').val(layer.fixmystreet.body_found); + }, + + not_found: function(layer) { + if ( $('#road-warning').length ) { + $('#road-warning').remove(); + } + $('#single_body_only').val(layer.fixmystreet.body_council); + } + }, + body_found: 'TfL', + body_council: 'Bromley Council' })); var prow_stylemap = new OpenLayers.StyleMap({ -- cgit v1.2.3