diff options
author | Dave Arter <davea@mysociety.org> | 2019-11-07 10:49:34 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2019-12-09 12:48:12 +0000 |
commit | 7deabe2f9f29b8129e8a38174e2292c41b121bfe (patch) | |
tree | 26ddd9f0757d6fc1ec5383bb818c44e576effefa /web | |
parent | ceaebc7bd3746cfeb90ba895e7480cb73b0fd756 (diff) |
[TfL] Some categories only report on red routes.
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/tfl/assets.js | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/web/cobrands/tfl/assets.js b/web/cobrands/tfl/assets.js index ce8f3f650..24d95b465 100644 --- a/web/cobrands/tfl/assets.js +++ b/web/cobrands/tfl/assets.js @@ -60,4 +60,72 @@ fixmystreet.assets.add(asset_defaults, { asset_item: 'bus stop' }); + +/* Red routes (TLRN) asset layer & handling for disabling form when red route + is not selected for specific categories. */ + +var tlrn_stylemap = new OpenLayers.StyleMap({ + 'default': new OpenLayers.Style({ + fillColor: "#ff0000", + fillOpacity: 0.3, + strokeColor: "#ff0000", + strokeOpacity: 0.6, + strokeWidth: 2 + }) +}); + + +/* Reports in these categories can only be made on a red route */ +var tlrn_categories = [ + "All out - three or more street lights in a row", + "Blocked drain", + "Damage - general (Trees)", + "Dead animal in the carriageway or footway", + "Debris in the carriageway", + "Fallen Tree", + "Flooding", + "Flytipping", + "Graffiti / Flyposting (non-offensive)", + "Graffiti / Flyposting (offensive)", + "Graffiti / Flyposting on street light (non-offensive)", + "Graffiti / Flyposting on street light (offensive)", + "Grass Cutting and Hedges", + "Hoardings blocking carriageway or footway", + "Light on during daylight hours", + "Lights out in Pedestrian Subway", + "Low hanging branches and general maintenance", + "Manhole Cover - Damaged (rocking or noisy)", + "Manhole Cover - Missing", + "Mobile Crane Operation", + "Pavement Defect (uneven surface / cracked paving slab)", + "Pothole", + "Roadworks", + "Scaffolding blocking carriageway or footway", + "Single Light out (street light)", + "Standing water", + "Unstable hoardings", + "Unstable scaffolding", + "Worn out road markings" +]; + +fixmystreet.assets.add(defaults, { + http_options: { + url: "https://tilma.mysociety.org/mapserver/tfl", + params: { + TYPENAME: "RedRoutes" + } + }, + max_resolution: 9.554628534317017, + road: true, + non_interactive: true, + asset_category: tlrn_categories, + nearest_radius: 0.1, + stylemap: tlrn_stylemap, + no_asset_msg_id: '#js-not-tfl-road', + actions: { + found: fixmystreet.message_controller.road_found, + not_found: fixmystreet.message_controller.road_not_found + } +}); + })(); |