{"action":"created","issue":{"url":"https://api.github.com/repos/kartena/Proj4Leaflet/issues/82","repository_url":"https://api.github.com/repos/kartena/Proj4Leaflet","labels_url":"https://api.github.com/repos/kartena/Proj4Leaflet/issues/82/labels{/name}","comments_url":"https://api.github.com/repos/kartena/Proj4Leaflet/issues/82/comments","events_url":"https://api.github.com/repos/kartena/Proj4Leaflet/issues/82/events","html_url":"https://github.com/kartena/Proj4Leaflet/issues/82","id":56913828,"number":82,"title":"Invalid LatLng object (NaN, NaN) when trying to zoom out/in","user":{"login":"pmikla14","id":8409855,"avatar_url":"https://avatars.githubusercontent.com/u/8409855?v=3","gravatar_id":"","url":"https://api.github.com/users/pmikla14","html_url":"https://github.com/pmikla14","followers_url":"https://api.github.com/users/pmikla14/followers","following_url":"https://api.github.com/users/pmikla14/following{/other_user}","gists_url":"https://api.github.com/users/pmikla14/gists{/gist_id}","starred_url":"https://api.github.com/users/pmikla14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmikla14/subscriptions","organizations_url":"https://api.github.com/users/pmikla14/orgs","repos_url":"https://api.github.com/users/pmikla14/repos","events_url":"https://api.github.com/users/pmikla14/events{/privacy}","received_events_url":"https://api.github.com/users/pmikla14/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2015-02-07T14:59:59Z","updated_at":"2016-09-01T06:20:22Z","closed_at":null,"body":"I tried to include a specific open-data map from the Austrian government with the coordinate system EPSG 31258. The map shows up, but only in one zoom level (17). When i try to switch the zoom level I get an Invalid LatLng object (NaN, NaN) error. Dragging around works fine.\r\n\r\nCould anybody tell me if there is an error in my code?\r\n\r\n\t\t<script>\r\n\t\twindow.addEventListener('load', init); \r\n\t\tfunction init() { \r\n\t\t\tvar\tcrs31258 = new L.Proj.CRS('urn:ogc:def:crs:EPSG::31258',\r\n\t\t\t\t  \"+proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0=450000 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m +no_defs\",\r\n\t\t\t\t  {\r\n\t\t\t\t\torigin: [-5172500.0, 5001000.0],\r\n\t\t\t\t\tscales: [1511811, 755906, 377953, 188976, 94488, 56693, 37795, 18898, 11339, 9449, 7559, 5669, 3780, 1890, 945],\r\n\t\t\t\t\tresolutions: [400.00079375158754, 200.000529167725, 100.0002645838625, 50, 25, 15.000052916772502, 9.9999470832275, 5.000105833545001, 3.0001164168995005, 2.5000529167725003, 1.9999894166455001, 1.4999259165184997, 1.0001270002540006, 0.5000635001270003, 0.25003175006350015],\r\n\t\t\t\t  });\r\n\t\t\t\r\n\t\tvar map = L.map('map', {\r\n\t\t\tcrs: crs31258,\r\n\t\t\tminZoom: 8\r\n\t\t}).setView([46.66411, 14.63602], 17);\r\n\t\t\r\n\t\t\r\n\t\tvar basemap = new L.TileLayer(\"http://gis.ktn.gv.at/arcgis/rest/services/tilecache/Ortho_2010_2012/MapServer/tile/{z}/{y}/{x}\", {\r\n\t\t\ttileSize: 512,\r\n\t\t\tmaxZoom: 19,\r\n\t\t\tzoomOffset: -5\r\n\t\t});\r\n\t\t\r\n\t\tmap.addLayer(basemap);\r\n\t\t\r\n\t}\r\n\t</script>\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/kartena/Proj4Leaflet/issues/comments/243986646","html_url":"https://github.com/kartena/Proj4Leaflet/issues/82#issuecomment-243986646","issue_url":"https://api.github.com/repos/kartena/Proj4Leaflet/issues/82","id":243986646,"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":"2016-09-01T06:20:22Z","updated_at":"2016-09-01T06:20:22Z","body":"@jduckworth Digging through the stacktrace, it seems the projection in the fiddle isn't well defined for the point `(0, 0)` - doing inverse returns the lat/lng `(0, NaN)`.\r\n\r\nI note that `(0,0)` is well outside the projected bounds if you look at http://epsg.io/3572, so the problem is probably trying to use the projection outside its bounds.  I think it should work if you try to limit the map's bounds to avoid it loading these tiles."}}
{"actor":{"display_login":"perliedman"}}