{"action":"created","issue":{"url":"https://api.github.com/repos/openlayers/ol3/issues/4594","labels_url":"https://api.github.com/repos/openlayers/ol3/issues/4594/labels{/name}","comments_url":"https://api.github.com/repos/openlayers/ol3/issues/4594/comments","events_url":"https://api.github.com/repos/openlayers/ol3/issues/4594/events","html_url":"https://github.com/openlayers/ol3/pull/4594","id":123922386,"number":4594,"title":"Fix for TileQueue gradually choking up when using raster reprojection","user":{"login":"petrsloup","id":707817,"avatar_url":"https://avatars.githubusercontent.com/u/707817?v=3","gravatar_id":"","url":"https://api.github.com/users/petrsloup","html_url":"https://github.com/petrsloup","followers_url":"https://api.github.com/users/petrsloup/followers","following_url":"https://api.github.com/users/petrsloup/following{/other_user}","gists_url":"https://api.github.com/users/petrsloup/gists{/gist_id}","starred_url":"https://api.github.com/users/petrsloup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petrsloup/subscriptions","organizations_url":"https://api.github.com/users/petrsloup/orgs","repos_url":"https://api.github.com/users/petrsloup/repos","events_url":"https://api.github.com/users/petrsloup/events{/privacy}","received_events_url":"https://api.github.com/users/petrsloup/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-26T10:18:16Z","updated_at":"2015-12-28T08:38:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openlayers/ol3/pulls/4594","html_url":"https://github.com/openlayers/ol3/pull/4594","diff_url":"https://github.com/openlayers/ol3/pull/4594.diff","patch_url":"https://github.com/openlayers/ol3/pull/4594.patch"},"body":"In v3.12.1 release, the tile queue can occasionally get \"full\" (too many tiles are registered as currently loading) and no more tiles are loaded.\r\nSee http://openlayers.org/en/v3.12.1/examples/reprojection-wgs84.html (try zooming and panning the map for a while, until the loading stucks and no more tiles are loaded and reprojected).\r\n\r\nThis took me a while to notice and track down, but it is related to the changes introduced in https://github.com/openlayers/ol3/pull/4536.\r\n\r\nWhen all the source tiles for the reprojection are already loaded, the reprojection (and state change) happens *synchronously* in `ol.reproj.Tile#load`. The tile is registered to `ol.TileQueue#tilesLoadingKeys_` *after* this call, but it is never removed since the `change` event is fired from inside the `load` method.\r\n\r\nThe fix for this is fairly straightforward.\r\nAlso, if anyone thinks it's a good idea, I can modify https://github.com/openlayers/ol3/blob/v3.12.1/src/ol/reproj/tile.js#L325 so that the `ol.reproj.Tile#load` is always async (`setTimeout(..., 0)` ?), but I don't think it's necessary.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/openlayers/ol3/issues/comments/167513057","html_url":"https://github.com/openlayers/ol3/pull/4594#issuecomment-167513057","issue_url":"https://api.github.com/repos/openlayers/ol3/issues/4594","id":167513057,"user":{"login":"petrsloup","id":707817,"avatar_url":"https://avatars.githubusercontent.com/u/707817?v=3","gravatar_id":"","url":"https://api.github.com/users/petrsloup","html_url":"https://github.com/petrsloup","followers_url":"https://api.github.com/users/petrsloup/followers","following_url":"https://api.github.com/users/petrsloup/following{/other_user}","gists_url":"https://api.github.com/users/petrsloup/gists{/gist_id}","starred_url":"https://api.github.com/users/petrsloup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petrsloup/subscriptions","organizations_url":"https://api.github.com/users/petrsloup/orgs","repos_url":"https://api.github.com/users/petrsloup/repos","events_url":"https://api.github.com/users/petrsloup/events{/privacy}","received_events_url":"https://api.github.com/users/petrsloup/received_events","type":"User","site_admin":false},"created_at":"2015-12-28T08:38:46Z","updated_at":"2015-12-28T08:38:46Z","body":"@ahocevar OK, I added the change. You're right it's good to have a consistent behavior.\r\n\r\nSo now we actually have two fixes for the single issue in this PR, but both changes make sense.\r\n"}}