{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/3474","repository_url":"https://api.github.com/repos/mapbox/mapbox-gl-js","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/3474/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/3474/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/3474/events","html_url":"https://github.com/mapbox/mapbox-gl-js/issues/3474","id":185690673,"number":3474,"title":"fitBounds randomly throw failed to invert matrix","user":{"login":"nrako","id":425397,"avatar_url":"https://avatars.githubusercontent.com/u/425397?v=3","gravatar_id":"","url":"https://api.github.com/users/nrako","html_url":"https://github.com/nrako","followers_url":"https://api.github.com/users/nrako/followers","following_url":"https://api.github.com/users/nrako/following{/other_user}","gists_url":"https://api.github.com/users/nrako/gists{/gist_id}","starred_url":"https://api.github.com/users/nrako/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nrako/subscriptions","organizations_url":"https://api.github.com/users/nrako/orgs","repos_url":"https://api.github.com/users/nrako/repos","events_url":"https://api.github.com/users/nrako/events{/privacy}","received_events_url":"https://api.github.com/users/nrako/received_events","type":"User","site_admin":false},"labels":[{"id":31015436,"url":"https://api.github.com/repos/mapbox/mapbox-gl-js/labels/bug","name":"bug","color":"0052cc","default":true}],"state":"closed","locked":false,"assignee":{"login":"mourner","id":25395,"avatar_url":"https://avatars.githubusercontent.com/u/25395?v=3","gravatar_id":"","url":"https://api.github.com/users/mourner","html_url":"https://github.com/mourner","followers_url":"https://api.github.com/users/mourner/followers","following_url":"https://api.github.com/users/mourner/following{/other_user}","gists_url":"https://api.github.com/users/mourner/gists{/gist_id}","starred_url":"https://api.github.com/users/mourner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mourner/subscriptions","organizations_url":"https://api.github.com/users/mourner/orgs","repos_url":"https://api.github.com/users/mourner/repos","events_url":"https://api.github.com/users/mourner/events{/privacy}","received_events_url":"https://api.github.com/users/mourner/received_events","type":"User","site_admin":false},"assignees":[{"login":"mourner","id":25395,"avatar_url":"https://avatars.githubusercontent.com/u/25395?v=3","gravatar_id":"","url":"https://api.github.com/users/mourner","html_url":"https://github.com/mourner","followers_url":"https://api.github.com/users/mourner/followers","following_url":"https://api.github.com/users/mourner/following{/other_user}","gists_url":"https://api.github.com/users/mourner/gists{/gist_id}","starred_url":"https://api.github.com/users/mourner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mourner/subscriptions","organizations_url":"https://api.github.com/users/mourner/orgs","repos_url":"https://api.github.com/users/mourner/repos","events_url":"https://api.github.com/users/mourner/events{/privacy}","received_events_url":"https://api.github.com/users/mourner/received_events","type":"User","site_admin":false}],"milestone":null,"comments":13,"created_at":"2016-10-27T14:49:37Z","updated_at":"2016-11-07T12:52:06Z","closed_at":"2016-11-02T20:17:42Z","body":"Encountered on versions 0.21.0 && 0.25.1\n\nSorry about the \"**randomly** issue\", hard to reproduce, and I believe it's a size / timing issue. Which is also why I got fed-up with trying to debug it and just have hanging breakpoints waiting for next occurrences.\n\nI'm sharing my finding hoping someone can help pin-point the root issue.\n\n[`Transform.latY(lat, worldSize)`](https://github.com/mapbox/mapbox-gl-js/blob/master/js/geo/transform.js#L224) Sometimes receive a `lat` of `-90` and then return `Infinity`. (Is that expected???)\n\n``` javascript\nconst y = 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + lat * Math.PI / 360));\n```\n\nThis results is then used (through `this.y`) to calculate the matrices:\nhttps://github.com/mapbox/mapbox-gl-js/blob/master/js/geo/transform.js#L455\n\nResulting in `NaN` which end up raising the `failed to invert matrix` https://github.com/mapbox/mapbox-gl-js/blob/master/js/geo/transform.js#L467\n\nI don't yet understand why `latY()` randomly receives `lat: -90`, but this all start with `fitBounds` with options: `linear: true`, a padding and offset.\n"},"comment":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/comments/258827718","html_url":"https://github.com/mapbox/mapbox-gl-js/issues/3474#issuecomment-258827718","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/3474","id":258827718,"user":{"login":"nrako","id":425397,"avatar_url":"https://avatars.githubusercontent.com/u/425397?v=3","gravatar_id":"","url":"https://api.github.com/users/nrako","html_url":"https://github.com/nrako","followers_url":"https://api.github.com/users/nrako/followers","following_url":"https://api.github.com/users/nrako/following{/other_user}","gists_url":"https://api.github.com/users/nrako/gists{/gist_id}","starred_url":"https://api.github.com/users/nrako/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nrako/subscriptions","organizations_url":"https://api.github.com/users/nrako/orgs","repos_url":"https://api.github.com/users/nrako/repos","events_url":"https://api.github.com/users/nrako/events{/privacy}","received_events_url":"https://api.github.com/users/nrako/received_events","type":"User","site_admin":false},"created_at":"2016-11-07T12:52:06Z","updated_at":"2016-11-07T12:52:06Z","body":"@ArntB [v0.26.0](https://github.com/mapbox/mapbox-gl-js/releases/tag/v0.26.0) is currently 141 commits behind master, the fix hasn't been released yet."}}
{"actor":{"display_login":"nrako"}}