From aa2f4800f32de0f965dffc42a8f59a11d404b0bc Mon Sep 17 00:00:00 2001 From: Norbert Renner Date: Mon, 3 Feb 2014 21:12:33 +0100 Subject: [PATCH] add OpenTopoMap and Thunderforest layers --- js/index.js | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/js/index.js b/js/index.js index 7fcbfef..b0fa803 100644 --- a/js/index.js +++ b/js/index.js @@ -7,20 +7,29 @@ (function() { function initMap() { - var odblAttribution = 'data © OpenStreetMap contributors ' - + '(ODbL)'; - - var landscape = L.tileLayer('http://{s}.tile.thunderforest.com/landscape/{z}/{x}/{y}.png', { - maxZoom: 18, - attribution: 'tiles © Thunderforest ' - + '(CC-BY-SA 2.0)' + odblAttribution - }); - var osm = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 19, attribution: 'tiles © OpenStreetMap contributors' }); + var topo = L.tileLayer('http://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', { + minZoom: 5, + maxZoom: 15, + attribution: 'tiles © OpenTopoMap, CC-BY-SA' + + ', SRTM' + }); + + var thunderforestAttribution = 'tiles © Thunderforest ' + + '(CC-BY-SA 2.0)'; + var cycle = L.tileLayer('http://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png', { + maxZoom: 18, + attribution: thunderforestAttribution + }); + var outdoors = L.tileLayer('http://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png', { + maxZoom: 18, + attribution: thunderforestAttribution + }); + var map = new L.Map('map', { layers: [osm], center: new L.LatLng(50.99, 9.86), @@ -33,7 +42,9 @@ L.control.layers({ 'OpenStreetMap': osm, - 'Landscape (Thunderforest)': landscape + 'OpenTopoMap': topo, + 'OpenCycleMap': cycle, + 'Outdoors': outdoors }, { /* 'Hiking (Waymarked Trails)': hiking