diff options
author | Struan Donald <struan@exo.org.uk> | 2018-03-27 17:34:12 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-06-04 14:09:31 +0100 |
commit | 07be4da57ab98fc955b0c88bb0049fd886a16b92 (patch) | |
tree | a270fdcaec2d3c05a73538efe1253edb2ad1f254 | |
parent | 1131880eb9a412410321c869a0aba85f3b343fde (diff) |
[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.
-rw-r--r-- | web/cobrands/bromley/map.js | 27 |
1 files changed, 26 insertions, 1 deletions
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: <a href="https://tfl.gov.uk/help-and-contact/contact-us-about-streets-and-other-road-issues">Street issues</a>'; + if ( $('#road-warning').length ) { + $('#road-warning').html(msg); + } else { + $('.change_location').after('<div class="box-warning" id="road-warning">' + msg + '</div>'); + } + $('#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({ |