{"action":"created","issue":{"url":"https://api.github.com/repos/kartena/Proj4Leaflet/issues/96","labels_url":"https://api.github.com/repos/kartena/Proj4Leaflet/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/kartena/Proj4Leaflet/issues/96/comments","events_url":"https://api.github.com/repos/kartena/Proj4Leaflet/issues/96/events","html_url":"https://github.com/kartena/Proj4Leaflet/issues/96","id":108149927,"number":96,"title":"Overlay custom TMS layer (3857) on another","user":{"login":"pieterdhondt","id":213126,"avatar_url":"https://avatars.githubusercontent.com/u/213126?v=3","gravatar_id":"","url":"https://api.github.com/users/pieterdhondt","html_url":"https://github.com/pieterdhondt","followers_url":"https://api.github.com/users/pieterdhondt/followers","following_url":"https://api.github.com/users/pieterdhondt/following{/other_user}","gists_url":"https://api.github.com/users/pieterdhondt/gists{/gist_id}","starred_url":"https://api.github.com/users/pieterdhondt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pieterdhondt/subscriptions","organizations_url":"https://api.github.com/users/pieterdhondt/orgs","repos_url":"https://api.github.com/users/pieterdhondt/repos","events_url":"https://api.github.com/users/pieterdhondt/events{/privacy}","received_events_url":"https://api.github.com/users/pieterdhondt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-24T15:06:05Z","updated_at":"2015-09-25T06:11:51Z","closed_at":null,"body":"How can I configure Proj4Leaflet to use [this TMS layer](https://quadridcmmaps.blob.core.windows.net/tynset/basemap.xml) as an overlay on a mapbox layer? I'm not sure how to set the bounds and origin...\r\n\r\nThis is what I have so far, but it requests the wrong row and columns...:\r\n\r\n```javascript\r\nvar crs = new L.Proj.CRS.TMS(\r\n            'EPSG:5181',\r\n            '+proj=tmerc +lat_0=38 +lon_0=127 +k=1 +x_0=200000 +y_0=500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs',\r\n            [-30000, -60000, 494288, 464288],\r\n            { resolutions: [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5, 0.25] }\r\n        );\r\n\r\n        var crs_tynset = new L.Proj.CRS.TMS(\r\n            'EPSG:3857',\r\n            '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs',\r\n            [-20026376.39, -20048966.10, 20026376.39, 20048966.10],\r\n        {\r\n            resolutions: [5.8135986328125, 2.90679931640625, 1.45339965820313, 0.726699829101563, 0.363349914550781, 0.181674957275391, 0.0908374786376953, 0.0454187393188477]\r\n            //origin: [1199098.1904393, 8923848.54918488]\r\n        });\r\n\r\n        var map = L.map('map', {\r\n            crs: crs_tynset,\r\n            continuousWorld: true,\r\n            worldCopyJump: false,\r\n            zoomControl: true\r\n        });\r\n\r\n        L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {\r\n            attribution: 'Mapbox',\r\n            maxZoom: 18,\r\n            id: 'mapbox.light',\r\n            accessToken: 'pk.eyJ1IjoicGlldGVyZGhvbmR0IiwiYSI6ImNpZXdvdWx0OTAwMTJzeWx6cTVxZmJ0NjgifQ.lODhO-2hLwWsk8nr12VrCg'\r\n        }).addTo(map);\r\n\r\n        new L.TileLayer('http://quadridcmmaps.blob.core.windows.net/tynset/{z}/{x}/{y}.png', {\r\n            tms: true\r\n        }).addTo(map);\r\n\r\n        map.setView([62.27597, 10.78254], 0);\r\n```\r\n\r\nAnyone knows whats wrong and how to do it right?"},"comment":{"url":"https://api.github.com/repos/kartena/Proj4Leaflet/issues/comments/143138287","html_url":"https://github.com/kartena/Proj4Leaflet/issues/96#issuecomment-143138287","issue_url":"https://api.github.com/repos/kartena/Proj4Leaflet/issues/96","id":143138287,"user":{"login":"perliedman","id":1246614,"avatar_url":"https://avatars.githubusercontent.com/u/1246614?v=3","gravatar_id":"","url":"https://api.github.com/users/perliedman","html_url":"https://github.com/perliedman","followers_url":"https://api.github.com/users/perliedman/followers","following_url":"https://api.github.com/users/perliedman/following{/other_user}","gists_url":"https://api.github.com/users/perliedman/gists{/gist_id}","starred_url":"https://api.github.com/users/perliedman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/perliedman/subscriptions","organizations_url":"https://api.github.com/users/perliedman/orgs","repos_url":"https://api.github.com/users/perliedman/repos","events_url":"https://api.github.com/users/perliedman/events{/privacy}","received_events_url":"https://api.github.com/users/perliedman/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T06:11:51Z","updated_at":"2015-09-25T06:11:51Z","body":"@pieterdhondt you shouldn't have to use Proj4Leaflet at all in this scenario. EPSG:3857 is the default projection built into Leaflet. Adding the tile layer with `tms` set to true should be enough.\r\n\r\nHaving said that, I see that you code defines `crs` to EPSG:5181, but seems to never be used, why is that?\r\n\r\nAlso, this _should_ work in Proj4Leaflet. If you could set up a jsfiddle or similar with this code, it would be easier to test."}}