diff options
author | Jonas Smedegaard <dr@jones.dk> | 2016-02-21 17:49:31 +0100 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2016-02-21 17:50:36 +0100 |
commit | b0747951eef537dc1988f3c83870c01c61d9419d (patch) | |
tree | c253628bb768d2191b147cbad6f3315eaf99b1be | |
parent | c22203c3312941c78cdcc8e10186f1205d27127b (diff) |
Add support for Stamen tiles.
-rw-r--r-- | templates/map.mdwn | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/templates/map.mdwn b/templates/map.mdwn index 5588da3b..a2e953ed 100644 --- a/templates/map.mdwn +++ b/templates/map.mdwn @@ -2,12 +2,22 @@ <div id="map"></div> <script src="/usr/share/javascript/leaflet/leaflet.js"></script> -<script> +<script><TMPL_IF stamen> +var attribOSM = 'Kartografi © <a href="https://stamen.com/">Stamen Design</a>' + +' under en <a href="https://creativecommons.org/licenses/by/3.0">Creative Commons Kreditering</a> licens.' + +' Data © <a href="https://www.openstreetmap.org/copyright#contributors">OpenStreetMap-bidragydere</a>' + +' under <a href="http://opendatacommons.org/licenses/odbl/">ODbL</a> licens'; +var OSMLayer = L.tileLayer('https://stamen-tiles.a.ssl.fastly.net/<TMPL_VAR stamen>/{z}/{x}/{y}.png', { attribution: attribOSM } );<TMPL_ELSE><TMPL_IF stamen-old> +var attribOSM = 'Kartografi © <a href="https://stamen.com/">Stamen Design</a>' + +' under en <a href="https://creativecommons.org/licenses/by/3.0">Creative Commons Kreditering</a> licens.' + +' Data © <a href="https://www.openstreetmap.org/copyright#contributors">OpenStreetMap-bidragydere</a>' + +' under en <a href="http://creativecommons.org/licenses/by-sa/3.0">Creative Commons Kreditering-DelPåSammeVilkår</a> licens'; +var OSMLayer = L.tileLayer('https://stamen-tiles.a.ssl.fastly.net/<TMPL_VAR stamen-old>/{z}/{x}/{y}.png', { attribution: attribOSM } );<TMPL_ELSE> var attribOSM = 'Kartografi © <a href="https://www.openstreetmap.org/copyright#contributors">OpenStreetMap-bidragydere</a>' +' under en <a href="https://creativecommons.org/licenses/by-sa/2.0/">Creative Commons Kreditering-DelPåSammeVilkår</a> licens.'; +' Data © <a href="http://osmfoundation.org/">OpenStreetMap Foundation</a>' +' under <a href="http://opendatacommons.org/licenses/odbl/">ODbL</a> licens'; -var OSMLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: attribOSM } ); +var OSMLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: attribOSM } );</TMPL_IF></TMPL_IF> var Box = L.latLngBounds( [[<TMPL_VAR bounds-nw>],[<TMPL_VAR bounds-se>]] ); var map = L.map('content', { layers: [OSMLayer] }).fitBounds(Box); map.attributionControl.setPrefix(false); |