diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-02-25 13:54:07 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-03-03 14:25:03 +0000 |
commit | a8080fad5eabd1ffef484e6979bea3c1eebd8978 (patch) | |
tree | 0ad8bf14f8b622be4eed313fed3b7cf053787206 /web | |
parent | 32f0e3ba1aaafb3c19708770c482dc529f481289 (diff) |
[UK] Use staging hosts on some staging sites.
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/isleofwight/assets.js | 7 | ||||
-rw-r--r-- | web/cobrands/northamptonshire/assets.js | 5 | ||||
-rw-r--r-- | web/cobrands/peterborough/assets.js | 7 | ||||
-rw-r--r-- | web/js/map-mastermap.js | 3 |
4 files changed, 6 insertions, 16 deletions
diff --git a/web/cobrands/isleofwight/assets.js b/web/cobrands/isleofwight/assets.js index e8d30e596..2710a9de7 100644 --- a/web/cobrands/isleofwight/assets.js +++ b/web/cobrands/isleofwight/assets.js @@ -4,14 +4,9 @@ if (!fixmystreet.maps) { return; } -var is_live = false; -if ( location.hostname === 'www.fixmystreet.com' || location.hostname === 'fms.islandroads.com' ) { - is_live = true; -} - var defaults = { http_options: { - url: is_live ? "https://tilma.mysociety.org/mapserver/iow": "https://staging.tilma.mysociety.org/mapserver/iow", + url: fixmystreet.staging ? "https://tilma.staging.mysociety.org/mapserver/iow": "https://tilma.mysociety.org/mapserver/iow", params: { SERVICE: "WFS", VERSION: "1.1.0", diff --git a/web/cobrands/northamptonshire/assets.js b/web/cobrands/northamptonshire/assets.js index b6f8f07f3..2b6cdeb69 100644 --- a/web/cobrands/northamptonshire/assets.js +++ b/web/cobrands/northamptonshire/assets.js @@ -4,10 +4,7 @@ if (!fixmystreet.maps) { return; } -var is_live = false; -if ( location.hostname === 'www.fixmystreet.com' || location.hostname == 'fixmystreet.northamptonshire.gov.uk' ) { - is_live = true; -} +var is_live = !fixmystreet.staging; var layers = [ /* diff --git a/web/cobrands/peterborough/assets.js b/web/cobrands/peterborough/assets.js index 2fb9075c8..b3cac5f6c 100644 --- a/web/cobrands/peterborough/assets.js +++ b/web/cobrands/peterborough/assets.js @@ -4,9 +4,10 @@ if (!fixmystreet.maps) { return; } + var defaults = { http_options: { - url: "https://tilma.mysociety.org/mapserver/peterborough", + url: fixmystreet.staging ? "https://tilma.staging.mysociety.org/mapserver/peterborough" : "https://tilma.mysociety.org/mapserver/peterborough", params: { SERVICE: "WFS", VERSION: "1.1.0", @@ -58,9 +59,6 @@ var trees_defaults = $.extend(true, {}, defaults, { asset_found: fixmystreet.message_controller.asset_found, asset_not_found: fixmystreet.message_controller.asset_not_found }, - http_options: { - url: "https://tilma.mysociety.org/mapserver/peterborough" - }, attributes: { tree_code: 'TREE_CODE' }, @@ -96,7 +94,6 @@ fixmystreet.assets.add(trees_defaults, { // The new tree request category is disabled in the other tree point layer. fixmystreet.assets.add(defaults, { http_options: { - url: "https://tilma.mysociety.org/mapserver/peterborough", params: { TYPENAME: "tree_points" } diff --git a/web/js/map-mastermap.js b/web/js/map-mastermap.js index d12a79bd0..bb9adf532 100644 --- a/web/js/map-mastermap.js +++ b/web/js/map-mastermap.js @@ -13,7 +13,8 @@ OpenLayers.Layer.MasterMap = OpenLayers.Class(OpenLayers.Layer.BingUK, { var urls = []; var servers = [ '', 'a.', 'b.', 'c.' ]; - var base = "//{S}tilma.mysociety.org/mastermap/${z}/${x}/${y}.png"; + var layer = fixmystreet.staging ? 'mastermap-staging' : 'mastermap'; + var base = "//{S}tilma.mysociety.org/" + layer + "/${z}/${x}/${y}.png"; for (var i=0; i < servers.length; i++) { urls.push( base.replace('{S}', servers[i]) ); } |