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
It's an old thread, but for historical purposes:
So, it's not an issue with the code (although I haven't checked your code).