{"action":"created","issue":{"url":"https://api.github.com/repos/Leaflet/Leaflet/issues/3280","labels_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/3280/labels{/name}","comments_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/3280/comments","events_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/3280/events","html_url":"https://github.com/Leaflet/Leaflet/issues/3280","id":59937580,"number":3280,"title":"Leaflet throwing \"Uncaught TypeError: Cannot read property 'lat' of undefined\" on valid LatLngBounds - fitbounds method, browserify","user":{"login":"melbourne2991","id":4619280,"avatar_url":"https://avatars.githubusercontent.com/u/4619280?v=3","gravatar_id":"","url":"https://api.github.com/users/melbourne2991","html_url":"https://github.com/melbourne2991","followers_url":"https://api.github.com/users/melbourne2991/followers","following_url":"https://api.github.com/users/melbourne2991/following{/other_user}","gists_url":"https://api.github.com/users/melbourne2991/gists{/gist_id}","starred_url":"https://api.github.com/users/melbourne2991/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melbourne2991/subscriptions","organizations_url":"https://api.github.com/users/melbourne2991/orgs","repos_url":"https://api.github.com/users/melbourne2991/repos","events_url":"https://api.github.com/users/melbourne2991/events{/privacy}","received_events_url":"https://api.github.com/users/melbourne2991/received_events","type":"User","site_admin":false},"labels":[],"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},"milestone":{"url":"https://api.github.com/repos/Leaflet/Leaflet/milestones/26","html_url":"https://github.com/Leaflet/Leaflet/milestones/1.0-beta2","labels_url":"https://api.github.com/repos/Leaflet/Leaflet/milestones/26/labels","id":1190479,"number":26,"title":"1.0-beta2","description":"","creator":{"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},"open_issues":0,"closed_issues":51,"state":"closed","created_at":"2015-07-02T11:59:33Z","updated_at":"2015-10-13T12:58:52Z","due_on":null,"closed_at":"2015-10-08T12:00:09Z"},"comments":12,"created_at":"2015-03-05T11:13:19Z","updated_at":"2016-01-11T08:27:11Z","closed_at":"2015-10-06T14:25:19Z","body":"I can't work this out, I am providing map.fitBounds with what appears to be a perfectly valid LatLngBounds object.\r\n\r\nconsole.log(bounds) gives me\r\n\r\nL.LatLngBounds {_southWest: L.LatLng, _northEast: L.LatLng, extend: function, pad: function, getCenter: function…}\r\n\r\nbounds.isValid() is true.\r\n\r\nYet when I try to use that same object with fitbounds I'm getting this elusive \r\n\r\nCannot read property 'lat' of undefined\"\r\n\r\nIt might be worth mentioning i'm using browserify?\r\n\r\nIf I provide fitbounds with an array instead (as shown below), it works fine!\r\n\r\n```\r\n\t\tconsole.log(center);\r\n\t\t\t\tconsole.log(bounds);\r\n\t\t\t\tconsole.log(data);\r\n\r\n\t\t\t\t_.forEach(data.hits, function(hit, i) {\r\n\t\t\t\t\tvar coords = hit._source.location.coords,\r\n\t\t\t\t\t\tlatLon = [coords.lat, coords.lon];\r\n\r\n\t\t\t\t\tbounds.extend(latLon);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tconsole.log('final bounds');\r\n\t\t\t\tconsole.log(bounds);\r\n\r\n\t\t\t\tmapObj.fitBounds([\r\n\t\t\t\t\t[-38.1249603,145.17332020000003],\r\n\t\t\t\t\t[-38.1770225,145.10952610000004]\r\n\t\t\t\t]);\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/Leaflet/Leaflet/issues/comments/170462517","html_url":"https://github.com/Leaflet/Leaflet/issues/3280#issuecomment-170462517","issue_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/3280","id":170462517,"user":{"login":"IvanSanchez","id":1125786,"avatar_url":"https://avatars.githubusercontent.com/u/1125786?v=3","gravatar_id":"","url":"https://api.github.com/users/IvanSanchez","html_url":"https://github.com/IvanSanchez","followers_url":"https://api.github.com/users/IvanSanchez/followers","following_url":"https://api.github.com/users/IvanSanchez/following{/other_user}","gists_url":"https://api.github.com/users/IvanSanchez/gists{/gist_id}","starred_url":"https://api.github.com/users/IvanSanchez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvanSanchez/subscriptions","organizations_url":"https://api.github.com/users/IvanSanchez/orgs","repos_url":"https://api.github.com/users/IvanSanchez/repos","events_url":"https://api.github.com/users/IvanSanchez/events{/privacy}","received_events_url":"https://api.github.com/users/IvanSanchez/received_events","type":"User","site_admin":false},"created_at":"2016-01-11T08:27:11Z","updated_at":"2016-01-11T08:27:11Z","body":"@damiendevienne @yohanboniface After linting the geoJSON, it works just fine:\r\n\r\nhttp://playground-leaflet.rhcloud.com/cex/1/edit?html,output"}}