{"action":"created","issue":{"url":"https://api.github.com/repos/Leaflet/Leaflet/issues/3787","labels_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/3787/labels{/name}","comments_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/3787/comments","events_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/3787/events","html_url":"https://github.com/Leaflet/Leaflet/issues/3787","id":103704718,"number":3787,"title":"custom image coordinate system issue","user":{"login":"wouwei","id":5656312,"avatar_url":"https://avatars.githubusercontent.com/u/5656312?v=3","gravatar_id":"","url":"https://api.github.com/users/wouwei","html_url":"https://github.com/wouwei","followers_url":"https://api.github.com/users/wouwei/followers","following_url":"https://api.github.com/users/wouwei/following{/other_user}","gists_url":"https://api.github.com/users/wouwei/gists{/gist_id}","starred_url":"https://api.github.com/users/wouwei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wouwei/subscriptions","organizations_url":"https://api.github.com/users/wouwei/orgs","repos_url":"https://api.github.com/users/wouwei/repos","events_url":"https://api.github.com/users/wouwei/events{/privacy}","received_events_url":"https://api.github.com/users/wouwei/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-08-28T11:52:38Z","updated_at":"2015-08-31T11:11:07Z","closed_at":null,"body":"Greetings Mourner and Perliedman,\r\nFirst , thanks a lot for your great and elegant solution ! \r\n\r\nAnd since it is a great solution, i'm trying to push the limits of it . =)\r\nI have a flat  image which makes around 360k X 385k. \r\ni did the basic implementation with LeaftLet 1.0 beta , that you can find a bit everywhere : \r\n\r\n```javascript\r\nvar map=L.map('main',{maxZoom :11,minZoom:4, crs: L.CRS.Simple} ).setView([0,0],11); \r\nvar southWest = map.unproject([0,385981],map.getMaxZoom());\r\nvar northEast = map.unproject([361939,0],map.getMaxZoom());\r\nmap.setMaxBounds(new L.LatLngBounds(southWest,northEast));\r\nL.tileLayer('quadtree/l{z}/{y}/{z}_{y}_{x}.jpg',{attribution:\"test\"}).addTo(map);\r\n```\r\n\r\n>A zooming  action will put you on the wrong coordinates . \r\n\r\nI noticed with these settings two things, with MAX zoom at start, and an expected view set to the top left of the image : \r\n1. reference point  in  lng/lat (0,0) is on the top left of the document, not the top/left of the first tile of the image. the first tile of the image have a margin-left and top of 300px , something like that.\r\n2. lng/lat (-1,1) is fixed on the top left corner of your image , or your first tile .\r\n3. zooming out will transform the coordinate system by 2^(zoom). The top left coordinate of the image will be lng/lat (-1,1), then (-2,2) then (-4,4) then (-8,8) , then 16 32 64... \r\n\r\n\r\nI'm digging up this issue since i really need both pixel and geo coordinates . I've got a few directions in mind  to explore , like : \r\n- basics : do i use the right RCS ? \r\n- in concept , does the global coordinate system is fixed at the top left corner of the tiled image ? \r\n- did i reversed the zoom ? "},"comment":{"url":"https://api.github.com/repos/Leaflet/Leaflet/issues/comments/136336735","html_url":"https://github.com/Leaflet/Leaflet/issues/3787#issuecomment-136336735","issue_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/3787","id":136336735,"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-08-31T11:11:07Z","updated_at":"2015-08-31T11:11:07Z","body":"I made a JSFiddle, trying to reproduce the problem: http://jsfiddle.net/dyn7s8c6/1/\r\n\r\nI added a marker that starts at (0, 0), you can drag it and the marker's position will be logged, both latlng and pixel coordinate.\r\n\r\n@wouwei I can't really see any obvious problem here, and it doesn't really look like the screenshots you've made - anything I'm missing here?"}}