GitHub PullRequestReviewCommentEvent at 2014-10-16 17:59:43
Repository: geojs
Actor: aashish24
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/comments/18973642","id":18973642,"diff_hunk":"@@ -162,41 +173,109 @@ geo.map = function (arg) {\n    * @returns {Number|geo.map}\n    */\n   ////////////////////////////////////////////////////////////////////////////\n-  this.zoom = function (val) {\n+  this.zoom = function (val, direction) {\n+    var base, evt;\n     if (val === undefined) {\n       return m_zoom;\n     }\n \n-    if (val !== m_zoom) {\n-      m_zoom = val;\n-      m_this.modified();\n+    if (val === m_zoom || val > m_validZoomRange.max || val < m_validZoomRange.min) {\n+      return m_this;\n+    }\n+\n+    base = m_this.baseLayer();\n+\n+    evt = {\n+      geo: {},\n+      zoomLevel: val,\n+      screenPosition: direction,\n+      eventType: geo.event.zoom\n+    };\n+    if (base) {\n+      base.renderer().geoTrigger(geo.event.zoom, evt, true);\n+    }\n+\n+    if (evt.geo.preventDefault) {\n+      return;\n     }\n \n-    // TODO Fix this\n-    //      m_this.geoTrigger(geo.event.zoom);\n+    m_zoom = val;\n+    m_this.children().forEach(function (child) {\n+      child.geoTrigger(geo.event.zoom, evt, true);\n+    });\n     return m_this;\n   };\n \n   ////////////////////////////////////////////////////////////////////////////\n   /**\n-   * Get/Set center of the map\n+   * Pan the map by (x: dx, y: dy) pixels.\n    *\n-   * @returns {Array|geo.map}\n+   * @param {Object} delta\n+   * @returns {geo.map}\n    */\n   ////////////////////////////////////////////////////////////////////////////\n-  this.center = function (val) {\n-    if (val === undefined) {\n-      return m_center;\n+  this.pan = function (delta) {\n+    var base = m_this.baseLayer(),\n+        evt;\n+\n+    evt = {\n+      geo: {},\n+      screenDelta: delta,\n+      eventType: geo.event.pan\n+    };\n+    // first pan the base layer\n+    if (base) {\n+      base.renderer().geoTrigger(geo.event.pan, evt, true);\n     }\n-    m_center = val.slice;\n-    // TODO Fix this\n-    //      m_this.geoTrigger(geo.event.center);\n+\n+    // If the base renderer says the pan is invalid, then cancel the action.\n+    if (evt.geo.preventDefault) {","path":"src/core/map.js","position":113,"original_position":113,"commit_id":"51bbbb1c6fe6cd395ebb0c04c347d05f510493a1","original_commit_id":"51bbbb1c6fe6cd395ebb0c04c347d05f510493a1","user":{"login":"aashish24","id":146527,"avatar_url":"https://avatars.githubusercontent.com/u/146527?v=2","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},"body":"I think that is reasonable since the interactor is set on the map. I would expect that. ","created_at":"2014-10-16T17:59:43Z","updated_at":"2014-10-16T17:59:43Z","html_url":"https://github.com/OpenGeoscience/geojs/pull/210#discussion_r18973642","pull_request_url":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/210","_links":{"self":{"href":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/comments/18973642"},"html":{"href":"https://github.com/OpenGeoscience/geojs/pull/210#discussion_r18973642"},"pull_request":{"href":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/210"}}},"pull_request":{"url":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/210","id":22609448,"html_url":"https://github.com/OpenGeoscience/geojs/pull/210","diff_url":"https://github.com/OpenGeoscience/geojs/pull/210.diff","patch_url":"https://github.com/OpenGeoscience/geojs/pull/210.patch","issue_url":"https://api.github.com/repos/OpenGeoscience/geojs/issues/210","number":210,"state":"open","locked":false,"title":"Moving mouse handler out of gl","user":{"login":"jbeezley","id":31890,"avatar_url":"https://avatars.githubusercontent.com/u/31890?v=2","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},"body":"This moves `mapInteractorStyle` out of gl and simplifies much of the gl renderer codebase.  The new interactor is customizable with different mouse button and keyboard modifiers and can be accessed through `map.interactor()`.  The interactor provides the current mouse position over the map through `interactor.mouse().map`.\r\n\r\nThe interaction events now occur as follows:\r\n  1. Raw DOM events are captured by the interactor.\r\n  2. The interactor updates its internal state.\r\n  3. When appropriate, the interactor calls `map.center` or `map.zoom`.\r\n  4. The map center and zoom methods trigger geojs events on the base layer's renderer.\r\n  5. The base layer's renderer modifies the event as necessary. (i.e. It can block the event, if the zoom level is invalid.)\r\n  6.  The map triggers the event on all layers.\r\n\r\nThe changes in this PR fix the following issues: #100, #142, #147, #163.","created_at":"2014-10-11T22:47:22Z","updated_at":"2014-10-16T17:59:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ad3ba8d0431b968e1d4af94c29ec199c95d9e563","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/210/commits","review_comments_url":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/210/comments","review_comment_url":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/comments/{number}","comments_url":"https://api.github.com/repos/OpenGeoscience/geojs/issues/210/comments","statuses_url":"https://api.github.com/repos/OpenGeoscience/geojs/statuses/51bbbb1c6fe6cd395ebb0c04c347d05f510493a1","head":{"label":"OpenGeoscience:standalone-mouse-handler","ref":"standalone-mouse-handler","sha":"51bbbb1c6fe6cd395ebb0c04c347d05f510493a1","user":{"login":"OpenGeoscience","id":3434706,"avatar_url":"https://avatars.githubusercontent.com/u/3434706?v=2","gravatar_id":"","url":"https://api.github.com/users/OpenGeoscience","html_url":"https://github.com/OpenGeoscience","followers_url":"https://api.github.com/users/OpenGeoscience/followers","following_url":"https://api.github.com/users/OpenGeoscience/following{/other_user}","gists_url":"https://api.github.com/users/OpenGeoscience/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenGeoscience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenGeoscience/subscriptions","organizations_url":"https://api.github.com/users/OpenGeoscience/orgs","repos_url":"https://api.github.com/users/OpenGeoscience/repos","events_url":"https://api.github.com/users/OpenGeoscience/events{/privacy}","received_events_url":"https://api.github.com/users/OpenGeoscience/received_events","type":"Organization","site_admin":false},"repo":{"id":12960038,"name":"geojs","full_name":"OpenGeoscience/geojs","owner":{"login":"OpenGeoscience","id":3434706,"avatar_url":"https://avatars.githubusercontent.com/u/3434706?v=2","gravatar_id":"","url":"https://api.github.com/users/OpenGeoscience","html_url":"https://github.com/OpenGeoscience","followers_url":"https://api.github.com/users/OpenGeoscience/followers","following_url":"https://api.github.com/users/OpenGeoscience/following{/other_user}","gists_url":"https://api.github.com/users/OpenGeoscience/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenGeoscience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenGeoscience/subscriptions","organizations_url":"https://api.github.com/users/OpenGeoscience/orgs","repos_url":"https://api.github.com/users/OpenGeoscience/repos","events_url":"https://api.github.com/users/OpenGeoscience/events{/privacy}","received_events_url":"https://api.github.com/users/OpenGeoscience/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenGeoscience/geojs","description":"JavaScript Geo visualization and Analysis Library","fork":false,"url":"https://api.github.com/repos/OpenGeoscience/geojs","forks_url":"https://api.github.com/repos/OpenGeoscience/geojs/forks","keys_url":"https://api.github.com/repos/OpenGeoscience/geojs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenGeoscience/geojs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenGeoscience/geojs/teams","hooks_url":"https://api.github.com/repos/OpenGeoscience/geojs/hooks","issue_events_url":"https://api.github.com/repos/OpenGeoscience/geojs/issues/events{/number}","events_url":"https://api.github.com/repos/OpenGeoscience/geojs/events","assignees_url":"https://api.github.com/repos/OpenGeoscience/geojs/assignees{/user}","branches_url":"https://api.github.com/repos/OpenGeoscience/geojs/branches{/branch}","tags_url":"https://api.github.com/repos/OpenGeoscience/geojs/tags","blobs_url":"https://api.github.com/repos/OpenGeoscience/geojs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenGeoscience/geojs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenGeoscience/geojs/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenGeoscience/geojs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenGeoscience/geojs/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenGeoscience/geojs/languages","stargazers_url":"https://api.github.com/repos/OpenGeoscience/geojs/stargazers","contributors_url":"https://api.github.com/repos/OpenGeoscience/geojs/contributors","subscribers_url":"https://api.github.com/repos/OpenGeoscience/geojs/subscribers","subscription_url":"https://api.github.com/repos/OpenGeoscience/geojs/subscription","commits_url":"https://api.github.com/repos/OpenGeoscience/geojs/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenGeoscience/geojs/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenGeoscience/geojs/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenGeoscience/geojs/issues/comments/{number}","contents_url":"https://api.github.com/repos/OpenGeoscience/geojs/contents/{+path}","compare_url":"https://api.github.com/repos/OpenGeoscience/geojs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenGeoscience/geojs/merges","archive_url":"https://api.github.com/repos/OpenGeoscience/geojs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenGeoscience/geojs/downloads","issues_url":"https://api.github.com/repos/OpenGeoscience/geojs/issues{/number}","pulls_url":"https://api.github.com/repos/OpenGeoscience/geojs/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenGeoscience/geojs/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenGeoscience/geojs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenGeoscience/geojs/labels{/name}","releases_url":"https://api.github.com/repos/OpenGeoscience/geojs/releases{/id}","created_at":"2013-09-19T21:39:25Z","updated_at":"2014-10-08T18:26:53Z","pushed_at":"2014-10-16T17:25:52Z","git_url":"git://github.com/OpenGeoscience/geojs.git","ssh_url":"git@github.com:OpenGeoscience/geojs.git","clone_url":"https://github.com/OpenGeoscience/geojs.git","svn_url":"https://github.com/OpenGeoscience/geojs","homepage":null,"size":12704,"stargazers_count":10,"watchers_count":10,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"open_issues_count":49,"forks":5,"open_issues":49,"watchers":10,"default_branch":"master"}},"base":{"label":"OpenGeoscience:master","ref":"master","sha":"5759490372157c1cade15b97d5a6b552e314f5ae","user":{"login":"OpenGeoscience","id":3434706,"avatar_url":"https://avatars.githubusercontent.com/u/3434706?v=2","gravatar_id":"","url":"https://api.github.com/users/OpenGeoscience","html_url":"https://github.com/OpenGeoscience","followers_url":"https://api.github.com/users/OpenGeoscience/followers","following_url":"https://api.github.com/users/OpenGeoscience/following{/other_user}","gists_url":"https://api.github.com/users/OpenGeoscience/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenGeoscience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenGeoscience/subscriptions","organizations_url":"https://api.github.com/users/OpenGeoscience/orgs","repos_url":"https://api.github.com/users/OpenGeoscience/repos","events_url":"https://api.github.com/users/OpenGeoscience/events{/privacy}","received_events_url":"https://api.github.com/users/OpenGeoscience/received_events","type":"Organization","site_admin":false},"repo":{"id":12960038,"name":"geojs","full_name":"OpenGeoscience/geojs","owner":{"login":"OpenGeoscience","id":3434706,"avatar_url":"https://avatars.githubusercontent.com/u/3434706?v=2","gravatar_id":"","url":"https://api.github.com/users/OpenGeoscience","html_url":"https://github.com/OpenGeoscience","followers_url":"https://api.github.com/users/OpenGeoscience/followers","following_url":"https://api.github.com/users/OpenGeoscience/following{/other_user}","gists_url":"https://api.github.com/users/OpenGeoscience/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenGeoscience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenGeoscience/subscriptions","organizations_url":"https://api.github.com/users/OpenGeoscience/orgs","repos_url":"https://api.github.com/users/OpenGeoscience/repos","events_url":"https://api.github.com/users/OpenGeoscience/events{/privacy}","received_events_url":"https://api.github.com/users/OpenGeoscience/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenGeoscience/geojs","description":"JavaScript Geo visualization and Analysis Library","fork":false,"url":"https://api.github.com/repos/OpenGeoscience/geojs","forks_url":"https://api.github.com/repos/OpenGeoscience/geojs/forks","keys_url":"https://api.github.com/repos/OpenGeoscience/geojs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenGeoscience/geojs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenGeoscience/geojs/teams","hooks_url":"https://api.github.com/repos/OpenGeoscience/geojs/hooks","issue_events_url":"https://api.github.com/repos/OpenGeoscience/geojs/issues/events{/number}","events_url":"https://api.github.com/repos/OpenGeoscience/geojs/events","assignees_url":"https://api.github.com/repos/OpenGeoscience/geojs/assignees{/user}","branches_url":"https://api.github.com/repos/OpenGeoscience/geojs/branches{/branch}","tags_url":"https://api.github.com/repos/OpenGeoscience/geojs/tags","blobs_url":"https://api.github.com/repos/OpenGeoscience/geojs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenGeoscience/geojs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenGeoscience/geojs/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenGeoscience/geojs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenGeoscience/geojs/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenGeoscience/geojs/languages","stargazers_url":"https://api.github.com/repos/OpenGeoscience/geojs/stargazers","contributors_url":"https://api.github.com/repos/OpenGeoscience/geojs/contributors","subscribers_url":"https://api.github.com/repos/OpenGeoscience/geojs/subscribers","subscription_url":"https://api.github.com/repos/OpenGeoscience/geojs/subscription","commits_url":"https://api.github.com/repos/OpenGeoscience/geojs/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenGeoscience/geojs/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenGeoscience/geojs/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenGeoscience/geojs/issues/comments/{number}","contents_url":"https://api.github.com/repos/OpenGeoscience/geojs/contents/{+path}","compare_url":"https://api.github.com/repos/OpenGeoscience/geojs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenGeoscience/geojs/merges","archive_url":"https://api.github.com/repos/OpenGeoscience/geojs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenGeoscience/geojs/downloads","issues_url":"https://api.github.com/repos/OpenGeoscience/geojs/issues{/number}","pulls_url":"https://api.github.com/repos/OpenGeoscience/geojs/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenGeoscience/geojs/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenGeoscience/geojs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenGeoscience/geojs/labels{/name}","releases_url":"https://api.github.com/repos/OpenGeoscience/geojs/releases{/id}","created_at":"2013-09-19T21:39:25Z","updated_at":"2014-10-08T18:26:53Z","pushed_at":"2014-10-16T17:25:52Z","git_url":"git://github.com/OpenGeoscience/geojs.git","ssh_url":"git@github.com:OpenGeoscience/geojs.git","clone_url":"https://github.com/OpenGeoscience/geojs.git","svn_url":"https://github.com/OpenGeoscience/geojs","homepage":null,"size":12704,"stargazers_count":10,"watchers_count":10,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"open_issues_count":49,"forks":5,"open_issues":49,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/210"},"html":{"href":"https://github.com/OpenGeoscience/geojs/pull/210"},"issue":{"href":"https://api.github.com/repos/OpenGeoscience/geojs/issues/210"},"comments":{"href":"https://api.github.com/repos/OpenGeoscience/geojs/issues/210/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/210/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/OpenGeoscience/geojs/pulls/210/commits"},"statuses":{"href":"https://api.github.com/repos/OpenGeoscience/geojs/statuses/51bbbb1c6fe6cd395ebb0c04c347d05f510493a1"}}}}