From 98acb27f5fde9de02aba5a73ce496b0107f67cac Mon Sep 17 00:00:00 2001 From: Norbert Renner Date: Tue, 14 Mar 2017 19:02:11 +0100 Subject: [PATCH] Add Thunderforest API key ("Hobby Project" plan), fixes #70 --- js/Map.js | 5 +++-- keys.js.template | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/js/Map.js b/js/Map.js index 26ac299..9f49e8f 100644 --- a/js/Map.js +++ b/js/Map.js @@ -31,12 +31,13 @@ BR.Map = { var thunderforestAttribution = 'tiles © Thunderforest ' + '(CC-BY-SA 2.0)'; - var cycle = L.tileLayer('http://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png', { + var thunderforestAuth = BR.keys.thunderforest ? '?apikey=' + BR.keys.thunderforest : ''; + var cycle = L.tileLayer('http://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png' + thunderforestAuth, { maxNativeZoom: 18, maxZoom: maxZoom, attribution: thunderforestAttribution }); - var outdoors = L.tileLayer('http://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png', { + var outdoors = L.tileLayer('http://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png' + thunderforestAuth, { maxNativeZoom: 18, maxZoom: maxZoom, attribution: thunderforestAttribution diff --git a/keys.js.template b/keys.js.template index 96b7a82..2597bd4 100644 --- a/keys.js.template +++ b/keys.js.template @@ -7,7 +7,10 @@ bing: '', // DigitalGlobe, https://developer.digitalglobe.com/maps-api/#plans - digitalGlobe: '' + digitalGlobe: '', + + // Thunderforest, http://thunderforest.com/pricing/ + thunderforest: '' }; })();