Raspberry Pi Pico Tips and Tricks

Monday 10 February 2014

Using the Outdoors tile server with leafet.js

The following post is a portion of the Leaflet Tips and Tricks book which is free to download. To use this post in context, consider it with the others in this blog or just download the the book as a pdf / epub or mobi .
----------------------------------------------------------

Outdoors

The ‘Outdoors’ set of map tiles is distributed by the good folks at Thunderforest who brought you OpenCycleMap. The tiles are aimed towards outdoor enthusiasts - for hiking, skiing and other activities. They are based on data from the OpenStreetMap project.

URL Template

http://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png

Usage policy

There are some simple guidelines on the Thunderforest terms and conditions page. The main concern with usage is the load placed on resources. So be gentle.

Attribution

Thunderforest provides open data, under a Creative Commons licence, specifically CC-BY-SA 2.0. The full details are available on their terms and conditions page. Attribution must be given to both “Thunderforest” and “OpenStreetMap contributors”. Users of your map must have a working link to www.thunderforest.com.

Usage example

mapLink = '<a href="http://openstreetmap.org">OpenStreetMap</a>';
outlink = '<a href="http://thunderforest.com/">Thunderforest</a>';
L.tileLayer(
    'http://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png', {
        attribution: '&copy; '+mapLink+' Contributors & '+outlink,
        maxZoom: 18,
    }).addTo(map);
Outdoors tile server map

More Examples

I will post separate examples of the usage of different tile servers as separate posts. Or you can find them all in Leaflet Tips and Tricks.

The description above (and heaps of other stuff) is in the Leaflet Tips and Tricks book that can be downloaded for free (or donate if you really want to :-)).

No comments:

Post a Comment