From f0ce1f66d9ce6feb03a32127716dda57c4a909f2 Mon Sep 17 00:00:00 2001 From: Charlie DeTar Date: Thu, 12 Feb 2015 13:00:42 -0700 Subject: [PATCH] Use stamen's SSL url when served under https: --- source/js/Core/Media/VMM.ExternalAPI.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/source/js/Core/Media/VMM.ExternalAPI.js b/source/js/Core/Media/VMM.ExternalAPI.js index be9e791..282b12d 100644 --- a/source/js/Core/Media/VMM.ExternalAPI.js +++ b/source/js/Core/Media/VMM.ExternalAPI.js @@ -908,26 +908,34 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') { map_providers: { "toner": { - "url": "//{S}tile.stamen.com/toner/{Z}/{X}/{Y}.png", + "url": (document.location.protocol === "https:" ? + "https://stamen-tiles-{S}a.ssl.fastly.net/toner/{Z}/{X}/{Y}.png" : + "//{S}tile.stamen.com/toner/{Z}/{X}/{Y}.png"), "minZoom": 0, "maxZoom": 20, "attribution": "stamen" }, "toner-lines": { - "url": "//{S}tile.stamen.com/toner-lines/{Z}/{X}/{Y}.png", + "url": (document.location.protocol === "https:" ? + "https://stamen-tiles-{S}a.ssl.fastly.net/toner-lines/{Z}/{X}/{Y}.png" : + "//{S}tile.stamen.com/toner-lines/{Z}/{X}/{Y}.png"), "minZoom": 0, "maxZoom": 20, "attribution": "stamen" }, "toner-labels": { - "url": "//{S}tile.stamen.com/toner-labels/{Z}/{X}/{Y}.png", + "url": (document.location.protocol === "https:" ? + "https://stamen-tiles-{S}a.ssl.fastly.net/toner-labels/{Z}/{X}/{Y}.png" : + "//{S}tile.stamen.com/toner-labels/{Z}/{X}/{Y}.png"), "minZoom": 0, "maxZoom": 20, "attribution": "stamen" }, "sterrain": { - "url": "//{S}tile.stamen.com/terrain/{Z}/{X}/{Y}.jpg", + "url": (document.location.protocol === "https:" ? + "https://stamen-tiles-{S}a.ssl.fastly.net/terrain/{Z}/{X}/{Y}.jpg" : + "//{S}tile.stamen.com/terrain/{Z}/{X}/{Y}.jpg"), "minZoom": 4, "maxZoom": 20, "attribution": "stamen" @@ -939,7 +947,9 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') { "attribution": "apple" }, "watercolor": { - "url": "//{S}tile.stamen.com/watercolor/{Z}/{X}/{Y}.jpg", + "url": (document.location.protocol === "https:" ? + "https://stamen-tiles-{S}a.ssl.fastly.net/watercolor/{Z}/{X}/{Y}.jpg" : + "//{S}tile.stamen.com/watercolor/{Z}/{X}/{Y}.jpg"), "minZoom": 3, "maxZoom": 16, "attribution": "stamen"