{"action":"created","issue":{"url":"https://api.github.com/repos/OpenGeoscience/geojs/issues/467","labels_url":"https://api.github.com/repos/OpenGeoscience/geojs/issues/467/labels{/name}","comments_url":"https://api.github.com/repos/OpenGeoscience/geojs/issues/467/comments","events_url":"https://api.github.com/repos/OpenGeoscience/geojs/issues/467/events","html_url":"https://github.com/OpenGeoscience/geojs/pull/467","id":118093823,"number":467,"title":"Discrete zoom and mouse event throttling","user":{"login":"jbeezley","id":31890,"avatar_url":"https://avatars.githubusercontent.com/u/31890?v=3","gravatar_id":"","url":"https://api.github.com/users/jbeezley","html_url":"https://github.com/jbeezley","followers_url":"https://api.github.com/users/jbeezley/followers","following_url":"https://api.github.com/users/jbeezley/following{/other_user}","gists_url":"https://api.github.com/users/jbeezley/gists{/gist_id}","starred_url":"https://api.github.com/users/jbeezley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbeezley/subscriptions","organizations_url":"https://api.github.com/users/jbeezley/orgs","repos_url":"https://api.github.com/users/jbeezley/repos","events_url":"https://api.github.com/users/jbeezley/events{/privacy}","received_events_url":"https://api.github.com/users/jbeezley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-11-20T18:03:37Z","updated_at":"2015-11-24T08:04:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/467","html_url":"https://github.com/OpenGeoscience/geojs/pull/467","diff_url":"https://github.com/OpenGeoscience/geojs/pull/467.diff","patch_url":"https://github.com/OpenGeoscience/geojs/pull/467.patch"},"body":"This adds new utility methods for throttling and debouncing functions.  These methods are used in the map interactor to throttle all mouse events to improve rendering performance.  In addition, zoom events are debounced to fix discrete zooming on touch devices, which fire small continuous scroll events rather than large discrete events like a traditional mouse wheel.\r\n\r\nThe interaction with discrete zooming isn't great for a couple of reasons.\r\n\r\n1.  There is a significant delay that occurs while the map is rendering\r\n2.  There is no indication that the zoom is doing anything at intermediate values\r\n\r\nIt may help to implement a \"snap to discrete values\" feature, but that is out of scope of this PR.  You can try the new behavior at the following link.\r\n\r\nhttp://jsbin.com/feduco/3"},"comment":{"url":"https://api.github.com/repos/OpenGeoscience/geojs/issues/comments/159189989","html_url":"https://github.com/OpenGeoscience/geojs/pull/467#issuecomment-159189989","issue_url":"https://api.github.com/repos/OpenGeoscience/geojs/issues/467","id":159189989,"user":{"login":"aashish24","id":146527,"avatar_url":"https://avatars.githubusercontent.com/u/146527?v=3","gravatar_id":"","url":"https://api.github.com/users/aashish24","html_url":"https://github.com/aashish24","followers_url":"https://api.github.com/users/aashish24/followers","following_url":"https://api.github.com/users/aashish24/following{/other_user}","gists_url":"https://api.github.com/users/aashish24/gists{/gist_id}","starred_url":"https://api.github.com/users/aashish24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aashish24/subscriptions","organizations_url":"https://api.github.com/users/aashish24/orgs","repos_url":"https://api.github.com/users/aashish24/repos","events_url":"https://api.github.com/users/aashish24/events{/privacy}","received_events_url":"https://api.github.com/users/aashish24/received_events","type":"User","site_admin":false},"created_at":"2015-11-24T08:04:44Z","updated_at":"2015-11-24T08:04:44Z","body":"> It shouldn't matter if it is the first time or not, there is no excuse for blocking the browser for that long for any reason. Especially when all that is happening is rendering a handful of small pngs.\r\n\r\nI agree. what I was wondering is that we should have seen this in current master as well (sounds like it should be happening but may be not realized because of the way our interactor works in master). \r\n\r\n> Drilling down into it, the issue is compiling the shaders. It spends almost 100% of the time here. It is compiling 4 shaders for every image it loads. Is this really necessary? Can't all of the tiles use the same shader program?\r\n\r\nGood point. They should be using the same material (shader + other attributes) and just need to bind their specific texture. I will push a branch today. \r\n\r\n"}}