aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-05-11 14:53:04 +0100
committerMatthew Somerville <matthew@mysociety.org>2012-05-11 14:53:04 +0100
commita2fcf4a4ba4fd1566626d49cd91f029b81c46bda (patch)
tree1056951d9f0fefb6244aa9333b634d7d3ed0cb40
parentbcd892e6efe119e63a2b98d8148b6651f87fcad9 (diff)
Fix some URLs so that it works under HTTPS.
-rw-r--r--perllib/FixMyStreet/Map/Bromley.pm5
-rw-r--r--perllib/FixMyStreet/Map/FMS.pm18
-rw-r--r--templates/web/bromley/footer.html2
-rw-r--r--web/cobrands/bromley/bromley.scss14
-rw-r--r--web/cobrands/bromley/layout.scss4
-rw-r--r--web/js/map-bing-ol.js28
6 files changed, 38 insertions, 33 deletions
diff --git a/perllib/FixMyStreet/Map/Bromley.pm b/perllib/FixMyStreet/Map/Bromley.pm
index 6d9dfa742..836efed39 100644
--- a/perllib/FixMyStreet/Map/Bromley.pm
+++ b/perllib/FixMyStreet/Map/Bromley.pm
@@ -12,12 +12,11 @@ use base 'FixMyStreet::Map::FMS';
use strict;
sub map_type {
- my $self = shift;
- return '"' . $self->map_tile_base . '"';
+ return '"/tilma"';
}
sub map_tile_base {
- return "tilma.mysociety.org/bromley";
+ "/tilma/%d/%d/%d.png";
}
1;
diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm
index 0ea4af4c1..4d0af983b 100644
--- a/perllib/FixMyStreet/Map/FMS.pm
+++ b/perllib/FixMyStreet/Map/FMS.pm
@@ -38,7 +38,7 @@ sub get_quadkey {
}
sub map_tile_base {
- "tilma.mysociety.org/sv";
+ "http://%stilma.mysociety.org/sv/%d/%d/%d.png";
}
sub map_tiles {
@@ -46,19 +46,19 @@ sub map_tiles {
if ($z >= 16) {
my $tile_base = $self->map_tile_base;
return [
- "http://a.$tile_base/$z/" . ($x-1) . "/" . ($y-1) . ".png",
- "http://b.$tile_base/$z/$x/" . ($y-1) . ".png",
- "http://c.$tile_base/$z/" . ($x-1) . "/$y.png",
- "http://$tile_base/$z/$x/$y.png",
+ sprintf($tile_base, 'a.', $z, $x-1, $y-1),
+ sprintf($tile_base, 'b.', $z, $x, $y-1),
+ sprintf($tile_base, 'c.', $z, $x-1, $y),
+ sprintf($tile_base, '', $z, $x, $y),
];
} else {
my $url = "g=701";
$url .= "&productSet=mmOS" if $z > 10;
return [
- "http://ecn.t0.tiles.virtualearth.net/tiles/r" . get_quadkey($x-1, $y-1, $z) . ".png?$url",
- "http://ecn.t1.tiles.virtualearth.net/tiles/r" . get_quadkey($x, $y-1, $z) . ".png?$url",
- "http://ecn.t2.tiles.virtualearth.net/tiles/r" . get_quadkey($x-1, $y, $z) . ".png?$url",
- "http://ecn.t3.tiles.virtualearth.net/tiles/r" . get_quadkey($x, $y, $z) . ".png?$url",
+ "//ecn.t0.tiles.virtualearth.net/tiles/r" . get_quadkey($x-1, $y-1, $z) . ".png?$url",
+ "//ecn.t1.tiles.virtualearth.net/tiles/r" . get_quadkey($x, $y-1, $z) . ".png?$url",
+ "//ecn.t2.tiles.virtualearth.net/tiles/r" . get_quadkey($x-1, $y, $z) . ".png?$url",
+ "//ecn.t3.tiles.virtualearth.net/tiles/r" . get_quadkey($x, $y, $z) . ".png?$url",
];
}
}
diff --git a/templates/web/bromley/footer.html b/templates/web/bromley/footer.html
index 6e28b5dd7..d60854daa 100644
--- a/templates/web/bromley/footer.html
+++ b/templates/web/bromley/footer.html
@@ -33,7 +33,7 @@
<div id="bromley-footer" class="desk-only">
<p class="copy">&copy; 2012 London Borough of Bromley</p>
- <a href="http://www.direct.gov.uk/"><img src="http://www.bromley.gov.uk/site/images/directgov.jpg" alt="Directgov website link - Public services all in one place" /></a>
+ <a href="http://www.direct.gov.uk/"><img src="https://www.bromley.gov.uk/site/images/directgov.jpg" alt="Directgov website link - Public services all in one place" /></a>
<ul class="footer-nav">
<li><a href="#bromley-header">To the top</a></li>
diff --git a/web/cobrands/bromley/bromley.scss b/web/cobrands/bromley/bromley.scss
index 7b2764d66..b49299697 100644
--- a/web/cobrands/bromley/bromley.scss
+++ b/web/cobrands/bromley/bromley.scss
@@ -15,7 +15,7 @@ select { background: #fff; border: 1px solid #768b9a; border-color: #768b9a #d1d
@include border-radius(0); }
.green-btn, button.green-btn, input.green-btn {
- background: #5b7189 url("http://www.bromley.gov.uk/site/styles/css_img/button.gif") repeat-x 0 -1px; border: 1px solid #8e9eb0; color: #fff; font-family: 'Gill Sans', 'Trebuchet MS', Calibri, sans-serif; font-weight: normal; margin: 0; min-height: 23px; outline: 1px solid #405062; padding: 4px 8px; text-transform: uppercase; }
+ background: #5b7189 url("https://www.bromley.gov.uk/site/styles/css_img/button.gif") repeat-x 0 -1px; border: 1px solid #8e9eb0; color: #fff; font-family: 'Gill Sans', 'Trebuchet MS', Calibri, sans-serif; font-weight: normal; margin: 0; min-height: 23px; outline: 1px solid #405062; padding: 4px 8px; text-transform: uppercase; }
.green-btn:hover, button.green-btn:hover, input.green-btn:hover { background: #5b7189; border: 1px solid #8e9eb0; }
.form-txt-submit-box input[type=submit] {
padding-top: 0; padding-bottom: 0; width: auto;
@@ -28,8 +28,8 @@ body { color: #333; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
// #header renamed to #bromley-header
#bromley-header { padding: 0 18px 0 25px; }
-.header-nav {float:right; background:url('http://www.bromley.gov.uk/site/styles/css_img/header-nav.gif') no-repeat; overflow:hidden; width:651px; height:34px; line-height:34px; padding:0 20px;}
-.header-nav li {float:left; width:130px; text-align:center; background:url('http://www.bromley.gov.uk/site/styles/css_img/header-nav-divider.gif') top right no-repeat;}
+.header-nav {float:right; background:url('https://www.bromley.gov.uk/site/styles/css_img/header-nav.gif') no-repeat; overflow:hidden; width:651px; height:34px; line-height:34px; padding:0 20px;}
+.header-nav li {float:left; width:130px; text-align:center; background:url('https://www.bromley.gov.uk/site/styles/css_img/header-nav-divider.gif') top right no-repeat;}
.header-nav li:last-child {background:none;}
.header-nav a:link, .header-nav a:visited {color:#fff; text-decoration:none;}
.header-nav a:hover, .header-nav a:active {text-decoration:underline;}
@@ -46,11 +46,11 @@ body { color: #333; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
.sign-in a:link, .sign-in a:visited {color:#333; font-weight:bold; text-decoration:none;}
.sign-in a:hover, .sign-in a:active {text-decoration:underline;}
-.main-menu {background:url('http://www.bromley.gov.uk/site/styles/css_img/main-menu.gif') no-repeat; width:689px; height:45px; margin-top:-60px; float:right; clear:right;}
+.main-menu {background:url('https://www.bromley.gov.uk/site/styles/css_img/main-menu.gif') no-repeat; width:689px; height:45px; margin-top:-60px; float:right; clear:right;}
.main-menu li {float:left; width:126px; padding-right:2px; text-align:center; font:150%/45px 'Gill Sans', 'Trebuchet MS', Calibri, sans-serif;}
.main-menu li a:link, .main-menu li a:visited {color:#fff; display:block; text-decoration:none;}
-.main-menu li a:hover, .main-menu li a:active {background:url('http://www.bromley.gov.uk/site/styles/css_img/main-menu-hover.gif') repeat-x;}
-.main-menu li.home a:hover, .main-menu li.home a:active {background:url('http://www.bromley.gov.uk/site/styles/css_img/main-menu-hover-home.gif') repeat-x;}
+.main-menu li a:hover, .main-menu li a:active {background:url('https://www.bromley.gov.uk/site/styles/css_img/main-menu-hover.gif') repeat-x;}
+.main-menu li.home a:hover, .main-menu li.home a:active {background:url('https://www.bromley.gov.uk/site/styles/css_img/main-menu-hover-home.gif') repeat-x;}
//#search { float: right; padding: 10px 17px; width: 270px; }
//#search label {display:none;}
@@ -58,7 +58,7 @@ body { color: #333; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
//#search input.button { background: #fff; border: 1px solid #8596a8; color: #333; font-family: 'Gill Sans', 'Trebuchet MS', Calibri, sans-serif; font-size:133%; height: 27px; line-height: 27px; padding: 0; vertical-align: top; width: 70px; }
// #footer renamed to #bromley-footer, fixed font size.
-#bromley-footer { background: #666 url('http://www.bromley.gov.uk/site/styles/css_img/footer.gif') top center no-repeat; clear: both; width:100%; padding:30px 15px 50px; margin-left:-15px; color:#fff; font-size:92%;}
+#bromley-footer { background: #666 url('https://www.bromley.gov.uk/site/styles/css_img/footer.gif') top center no-repeat; clear: both; width:100%; padding:30px 15px 50px; margin-left:-15px; color:#fff; font-size:92%;}
#bromley-footer a:link,
#bromley-footer a:visited { color: #fff; text-decoration: none; }
#bromley-footer a:hover,
diff --git a/web/cobrands/bromley/layout.scss b/web/cobrands/bromley/layout.scss
index 79a78d578..57c2dbd71 100644
--- a/web/cobrands/bromley/layout.scss
+++ b/web/cobrands/bromley/layout.scss
@@ -1,8 +1,8 @@
@import "_colours";
@import "../fixmystreet/_layout";
-body { background: #9b9b9b url('http://www.bromley.gov.uk/site/styles/css_img/repeater.gif') repeat-x; }
-#bromley-wrapper { background: #fff url('http://www.bromley.gov.uk/site/styles/css_img/header-corners.gif') center 110px no-repeat; margin: 1px auto 0; padding: 0 15px; width: 955px;}
+body { background: #9b9b9b url('https://www.bromley.gov.uk/site/styles/css_img/repeater.gif') repeat-x; }
+#bromley-wrapper { background: #fff url('https://www.bromley.gov.uk/site/styles/css_img/header-corners.gif') center 110px no-repeat; margin: 1px auto 0; padding: 0 15px; width: 955px;}
.offline #bromley-wrapper { padding: 0 15px 20px; }
// So that map appears underneath the header
diff --git a/web/js/map-bing-ol.js b/web/js/map-bing-ol.js
index 488dec58a..9bff93e27 100644
--- a/web/js/map-bing-ol.js
+++ b/web/js/map-bing-ol.js
@@ -41,7 +41,7 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
if (z >= 16) {
copyrights = 'Contains Ordnance Survey data &copy; Crown copyright and database right 2010';
} else {
- logo = '<a href="http://www.bing.com/maps/"><img border=0 src="http://dev.virtualearth.net/Branding/logo_powered_by.png"></a>';
+ logo = '<a href="http://www.bing.com/maps/"><img border=0 src="//dev.virtualearth.net/Branding/logo_powered_by.png"></a>';
copyrights = '&copy; 2011 <a href="http://www.bing.com/maps/">Microsoft</a>. &copy; AND, Navteq, Ordnance Survey';
}
this.attribution = OpenLayers.String.format(this.attributionTemplate, {
@@ -99,20 +99,26 @@ OpenLayers.Layer.Bing = OpenLayers.Class(OpenLayers.Layer.XYZ, {
var url;
if (z >= 16) {
- url = [
- "http://" + tile_base + "/${z}/${x}/${y}.png",
- "http://a." + tile_base + "/${z}/${x}/${y}.png",
- "http://b." + tile_base + "/${z}/${x}/${y}.png",
- "http://c." + tile_base + "/${z}/${x}/${y}.png"
- ];
+ if (tile_base.substring(0,1) == '/') {
+ url = [
+ tile_base + "/${z}/${x}/${y}.png"
+ ];
+ } else {
+ url = [
+ "http://" + tile_base + "/${z}/${x}/${y}.png",
+ "http://a." + tile_base + "/${z}/${x}/${y}.png",
+ "http://b." + tile_base + "/${z}/${x}/${y}.png",
+ "http://c." + tile_base + "/${z}/${x}/${y}.png"
+ ];
+ }
} else {
var type = '';
if (z > 10) { type = '&productSet=mmOS'; }
url = [
- "http://ecn.t0.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type,
- "http://ecn.t1.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type,
- "http://ecn.t2.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type,
- "http://ecn.t3.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type
+ "//ecn.t0.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type,
+ "//ecn.t1.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type,
+ "//ecn.t2.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type,
+ "//ecn.t3.tiles.virtualearth.net/tiles/r${id}.png?g=701" + type
];
}
var s = '' + x + y + z;