Use protocol relative URLs for imagery tiles
authorTom Hughes <tom@compton.nu>
Tue, 14 Feb 2017 19:19:57 +0000 (19:19 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 14 Feb 2017 19:19:57 +0000 (19:19 +0000)
cookbooks/imagery/resources/layer.rb
cookbooks/imagery/templates/default/imagery.js.erb

index aee757e..b1e7cc9 100644 (file)
@@ -47,7 +47,7 @@ action :create do
     mode 0o644
     content YAML.dump(:name => layer,
                       :title => title || layer,
-                      :url => "http://{s}.#{site}/layer/#{layer}/{z}/{x}/{y}.png",
+                      :url => "//{s}.#{site}/layer/#{layer}/{z}/{x}/{y}.png",
                       :attribution => copyright,
                       :default => default_layer,
                       :maxZoom => max_zoom,
index f992ef0..698c892 100644 (file)
@@ -6,7 +6,7 @@ function createMap(divName) {
   var layers = L.control.layers(null, null, {collapsed:false});
 
   // Add OpenStreetMap layer
-  layers.addBaseLayer(L.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
+  layers.addBaseLayer(L.tileLayer("//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
     attribution: "© <a target=\"_parent\" href=\"http://www.openstreetmap.org\">OpenStreetMap</a> and contributors, under an <a target=\"_parent\" href=\"http://www.openstreetmap.org/copyright\">open license</a>",
     maxZoom: 19
   }), "OpenStreetMap");