0

I'm new to XYZ tile maps.

I'm trying to add an XYZ map from geo.admin.ch the well known swiss map available to all bordering states.

Here I've found the leaflet link.

Here's the code

var map = new L.Map('map', {
  crs: L.CRS.EPSG3857,
  continuousWorld: true,
  worldCopyJump: false
});
var url = 'https://wmts20.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-farbe/default/current/3857/{z}/{x}/{y}.jpeg';
var tilelayer = new L.tileLayer(url);
map.addLayer(tilelayer);
map.setView(L.latLng(46.57591, 7.84956), 8);

and the API page

eesiraed
  • 4,626
  • 4
  • 16
  • 34

1 Answers1

0

It's an old thread, but for historical purposes:

  • You are not allowed to use WMTS from geo.admin.ch for desktop systems, only WMS, see official docs
  • Even for WMS, you cannot use the basemaps for free, like Swisstopo Pixelkarte`, see official docs. There is a credit system, with some map requests for free.

So, it's not an issue with the code (although I haven't checked your code).

Stephan
  • 372
  • 3
  • 7