From 1131880eb9a412410321c869a0aba85f3b343fde Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Fri, 16 Mar 2018 16:57:39 +0000 Subject: [Bromley] extra asset layers Adds street lights, park bins, trees, rights of way, and TfL red route asset layers. --- perllib/FixMyStreet/Map/Bromley.pm | 3 +- web/cobrands/bromley/map.js | 103 +++++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 1 deletion(-) diff --git a/perllib/FixMyStreet/Map/Bromley.pm b/perllib/FixMyStreet/Map/Bromley.pm index 1310c2a5a..22e4147f6 100644 --- a/perllib/FixMyStreet/Map/Bromley.pm +++ b/perllib/FixMyStreet/Map/Bromley.pm @@ -10,10 +10,11 @@ use base 'FixMyStreet::Map::FMS'; use strict; sub map_javascript { [ - '/vendor/OpenLayers/OpenLayers.fixmystreet.js', + '/vendor/OpenLayers/OpenLayers.buckinghamshire.js', '/js/map-OpenLayers.js', '/js/map-bing-ol.js', '/js/map-fms.js', + '/cobrands/fixmystreet/assets.js', '/cobrands/bromley/map.js', ] } diff --git a/web/cobrands/bromley/map.js b/web/cobrands/bromley/map.js index 0753907cc..622fbeed6 100644 --- a/web/cobrands/bromley/map.js +++ b/web/cobrands/bromley/map.js @@ -1 +1,104 @@ fixmystreet.maps.tile_base = [ [ "", "a-" ], "https://{S}fix.bromley.gov.uk/tilma" ]; + +(function(){ + +if (!fixmystreet.maps) { + return; +} + +var defaults = { + http_options: { + url: "https://tilma.staging.mysociety.org/mapserver/bromley_wfs", + params: { + SERVICE: "WFS", + VERSION: "1.1.0", + REQUEST: "GetFeature", + SRSNAME: "urn:ogc:def:crs:EPSG::3857" + } + }, + format_class: OpenLayers.Format.GML.v3.MultiCurveFix, + asset_type: 'spot', + max_resolution: 2.388657133579254, + min_resolution: 0.5971642833948135, + asset_id_field: 'CENTRAL_AS', + geometryName: 'msGeometry', + srsName: "EPSG:3857", + strategy_class: OpenLayers.Strategy.FixMyStreet +}; + +fixmystreet.assets.add($.extend(true, {}, defaults, { + http_options: { + params: { + TYPENAME: "Streetlights" + } + }, + asset_id_field: 'FEATURE_ID', + attributes: { + feature_id: 'FEATURE_ID' + }, + asset_category: ["Faulty street light"], + asset_item: 'street light' +})); + +fixmystreet.assets.add($.extend(true, {}, defaults, { + http_options: { + params: { + TYPENAME: "Bins" + } + }, + asset_category: ["Overflowing litter bin"], + asset_item: 'park bin', + asset_item_message: 'For our parks, pick a bin from the map »' +})); + +fixmystreet.assets.add($.extend(true, {}, defaults, { + http_options: { + params: { + TYPENAME: "Street_Trees" + } + }, + asset_category: ["Public Tree related issue"], + asset_item: 'tree' +})); + +var highways_stylemap = new OpenLayers.StyleMap({ + 'default': new OpenLayers.Style({ + fill: false, + stroke: false + }) +}); + +fixmystreet.assets.add($.extend(true, {}, defaults, { + http_options: { + params: { + TYPENAME: "TFL_Red_Route" + } + }, + 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 +})); + +var prow_stylemap = new OpenLayers.StyleMap({ + 'default': new OpenLayers.Style({ + fill: false, + fillOpacity: 0, + strokeColor: "#660099", + strokeOpacity: 0.5, + strokeWidth: 6 + }) +}); + +fixmystreet.assets.add($.extend(true, {}, defaults, { + http_options: { + params: { + TYPENAME: "PROW" + } + }, + stylemap: prow_stylemap, + always_visible: true, + non_interactive: true +})); + +})(); -- cgit v1.2.3