diff options
author | Struan Donald <struan@exo.org.uk> | 2019-04-15 11:00:34 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-04-23 17:34:00 +0100 |
commit | 48cfb3a952b0147b041f16207b79416a58bb7b36 (patch) | |
tree | 82d6e5400aa188189e36e9cd59d9f6116d107e65 | |
parent | a76475888c8b2f712aa567aa3c7fac41dc1d4d71 (diff) |
[Northamptonshire] set layer ids based on live/not live
The live ans staging sites use different layers to set the correct ones
depending on whether is_live is true
-rw-r--r-- | web/cobrands/northamptonshire/assets.js | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/web/cobrands/northamptonshire/assets.js b/web/cobrands/northamptonshire/assets.js index 0c2daab0f..97ac429ee 100644 --- a/web/cobrands/northamptonshire/assets.js +++ b/web/cobrands/northamptonshire/assets.js @@ -30,6 +30,11 @@ function disable_report_form() { $(".js-hide-if-invalid-category").hide(); } +var is_live = false; +if ( location.hostname === 'www.fixmystreet.com' || location.hostname == 'fixmystreet.northamptonshire.gov.uk' ) { + is_live = true; +} + var layers = [ /* { @@ -267,8 +272,8 @@ var layers = [ "categories": [ "Damaged / Missing / Facing Wrong Way", "Obscured by vegetation or Dirty" ], "item_name": "sign", "layer_name": "Signs", - "layer": 60, - "version": "60.2113-" + "layer": is_live ? 60 : 303, + "version": is_live ? "60.2113-" : "303.1-" }, { "categories": [ "Shelter Damaged", "Sign/Pole Damaged" ], @@ -326,8 +331,8 @@ var layers = [ "Restricted Visibility", ], "layer_name": "Tree", - "layer": 307, - "version": "307.1-" + "layer": is_live ? 307 : 228, + "version": is_live ? "307.1-" : "228.24-" }, { "categories": [ "Safety Bollard - Damaged/Missing" ], @@ -361,10 +366,6 @@ OpenLayers.Layer.NCCVectorAsset = OpenLayers.Class(OpenLayers.Layer.VectorAsset, CLASS_NAME: 'OpenLayers.Layer.NCCVectorAsset' }); -var is_live = false; -if ( location.hostname === 'www.fixmystreet.com' || location.hostname == 'fixmystreet.northamptonshire.gov.uk' ) { - is_live = true; -} // default options for northants assets include // a) checking for multiple assets in same location // b) preventing submission unless an asset is selected @@ -537,8 +538,8 @@ var highways_style = new OpenLayers.Style({ fixmystreet.assets.add($.extend(true, {}, northants_road_defaults, { protocol_class: OpenLayers.Protocol.Alloy, http_options: { - layerid: 20, - layerVersion: '20.123-', + layerid: is_live ? 20 : 308, + layerVersion: is_live ? '20.123-' : '308.8-', }, stylemap: new OpenLayers.StyleMap({ 'default': highways_style |