2

Trying to add the OpenSkiMap to my map, but I can't seem to get it to load. Any suggestions?

Define tile layer variables:

var osm = L.tileLayer('https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png');
skiTrails = L.tileLayer('http://tiles.skimap.org/openskimap/{z}/{x}/{y}.png');

var precip = L.tileLayer('https://tile.openweathermap.org/map/precipitation_new/{z}/{x}/{y}.png?appid='+myKey),
temp   = L.tileLayer('https://tile.openweathermap.org/map/temp_new/{z}/{x}/{y}.png?appid='+myKey);

Define the variables for the map tiles:

var map = L.map('map', {
    center: [39.73, -104.99],
    zoom: 10,
    layers: [precip, temp, osm, skiTrails]
});

var baseMap = {
    "OpenStreetMap": osm,
    "SkiAreas": skiTrails
};

var weatherData = {
    "Precipitation": precip,
    "Temperature": temp
};

Add all of the data to the map:

L.control.layers(baseMap,weatherData).addTo(map);

The "skiTrails" layer will not load, but everything else works fine.

scai
  • 20,297
  • 4
  • 56
  • 72
Vanludvig
  • 96
  • 1
  • 7
  • 1
    Is the console showing any errors? – peeebeee Oct 22 '18 at 08:09
  • It does not seem to be functional or under recent maintenance. In their examples they use [openstreetmap tiles](https://openskimap.org/#4.35/35.43/13.66) and [google maps](https://skimap.org/) respectively. – kboul Oct 22 '18 at 08:34

2 Answers2

3

Looks like skimap.org is using Google Maps and openskimap.org switched from raster tiles to vector tiles. So your tile URL can't work.

A possible alternative is OpenSnowMap. There are two tile URLs, one for the base map with relief and the other for the pistes as an additional layer:

  • https://tiles.opensnowmap.org/base_snow_map/{z}/{x}/{y}.png
  • https://tiles.opensnowmap.org/pistes/{z}/{x}/{y}.png

Make sure to respect their usage policy:

- use a valid referer
- prohibit bulk download from your app
- credit Data (c) www.openstreetmap.org & contributors ODBL and www.opensnowmap.org CC-BY-SA.
scai
  • 20,297
  • 4
  • 56
  • 72
0

As an addition on the excellent @scai answer, please note that only the pises overlay without relief is available from Opensnowmap.org:

 http://www.opensnowmap.org/pistes/{z}/{x}/{y}.png

Yves from Opensnowmap.org

yvecai
  • 1
  • Meanwhile the tile URL has changed to `https://tiles.opensnowmap.org/pistes/{z}/{x}/{y}.png`. – scai May 12 '20 at 09:36