I added a WMTS Layer to a Leaflet map. The tiles are loading but aren't in the correct order. Has anyone ever encountered this problem? If so, how did you overcome it?

enter image description here

    var map = new L.Map('viewerDiv', {
         crs: L.CRS.EPSG3857
    var url =
    var tilelayer = new L.tileLayer(url, {
        tileSize: 256,
        tms: true,
        attribution: 'World Map'
    map.setView(L.latLng(50, 8), 4);


  • 2
    do you have your z,x,and y coordinates correct?
    – nmtoken
    Aug 21, 2020 at 14:29

1 Answer 1


If you look at the tileset capabilites, you'll notice line <TileMatrixSet>GoogleMapsCompatible</TileMatrixSet>, which means this is standard Google Maps tileset. As @nmtoken pointed out, this means that x and y order should be reversed and that this is not TMS layer, so layer option tms should be left out:

var tilelayer = new L.tileLayer(
    tileSize: 256,
    attribution: 'World Map'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.