{"action":"created","comment":{"url":"https://api.github.com/repos/iTowns/itowns2/pulls/comments/116178099","pull_request_review_id":37781031,"id":116178099,"diff_hunk":"@@ -1506,6 +1606,130 @@ GlobeControls.prototype.isAnimationEnabled = function isAnimationEnabled() {\n     return enableAnimation;\n };\n \n+\n+/**\n+ * Returns the actual zoom level. The level will always be between the [getMinZoomLevel(), getMaxZoomLevel()].\n+ * @constructor\n+ * @return     {number}  The zoom level.\n+ */\n+GlobeControls.prototype.getZoomLevel = function getZoomLevel() {\n+    return computeTileZoomFromDistanceCamera(this.getRange());\n+};\n+\n+/**\n+ * Gets the current zoom level, which is an index in the logical scales predefined for the application.\n+ * The higher the level, the closer to the ground.\n+ * The level is always in the [getMinZoomLevel(), getMaxZoomLevel()] range.\n+ * @constructor\n+ * @param      {number}  zoom    The zoom\n+ * @param      {boolean}  isAnimated  Indicates if animated\n+ * @return     {Promise}\n+ */\n+GlobeControls.prototype.setZoomLevel = function setZoomLevel(zoom, isAnimated) {\n+    isAnimated = isAnimated === undefined ? this.isAnimationEnabled() : isAnimated;\n+    const range = computeDistanceCameraFromTileZoom(zoom);\n+    return this.setRange(range, isAnimated);\n+};\n+\n+/**\n+ * Return the current zoom scale at the central point of the view.\n+ * This function compute the scale of a map\n+ * @constructor\n+ * @param      {number}  pitch   Screen pitch, in millimeters ; 0.28 by default\n+ * @return     {number}  The zoom scale.\n+ */\n+GlobeControls.prototype.getScale = function getScale(pitch) {\n+    // TODO: Why error div size height in Chrome?\n+    // Screen pitch, in millimeters\n+    pitch = (pitch || 0.28) / 1000;\n+    const FOV = sizeRendering.FOV / 180 * Math.PI * 0.5;\n+    // projection one unit on screen\n+    const unitProjection = sizeRendering.height / (2 * this.getRange() * Math.tan(FOV));\n+    return pitch * unitProjection;\n+};\n+\n+/**\n+ * Changes the zoom level of the central point of screen so that screen acts as a map with a specified scale.\n+ *  The view flies to the desired zoom scale;\n+ * @param      {number}  scale  The scale\n+ * @param      {number}  pitch  The pitch\n+ * @param      {boolean}  isAnimated  Indicates if animated\n+ * @return     {Promise}\n+ */\n+GlobeControls.prototype.setScale = function setScale(scale, pitch, isAnimated) {\n+    isAnimated = isAnimated === undefined ? this.isAnimationEnabled() : isAnimated;\n+    const range = getRangeFromScale(scale);\n+    return this.setRange(range, isAnimated);\n+};\n+\n+/**\n+ * Changes the center of the scene on screen to the specified coordinates.\n+ * <iframe width=\"100%\" height=\"400\" src=\"//jsfiddle.net/iTownsIGN/x06yhbq6/embedded/\" allowfullscreen=\"allowfullscreen\" frameborder=\"0\"></iframe>\n+ * @param {Object} coordinates - The globe coordinates in EPSG_4326 projection to aim to\n+ * @param {number} coordinates.latitude\n+ * @param {number} coordinates.longitude\n+ * @param {number} coordinates.range\n+ * @param {boolean}  isAnimated - if the movement should be animated\n+ * @return {Promise} A promise that resolves when the next 'globe-loaded' event fires.\n+ */\n+GlobeControls.prototype.setCameraTargetGeoPosition = function setCameraTargetGeoPosition(coordinates, isAnimated) {","path":"src/Renderer/ThreeExtended/GlobeControls.js","position":591,"original_position":326,"commit_id":"db68f2968da66257647eabb42c4ff4345ad1dae9","original_commit_id":"dd1a72c97ad8f1cb40e46135fe6b62ff32c51d37","user":{"login":"vcoindet","id":16044646,"avatar_url":"https://avatars1.githubusercontent.com/u/16044646?v=3","gravatar_id":"","url":"https://api.github.com/users/vcoindet","html_url":"https://github.com/vcoindet","followers_url":"https://api.github.com/users/vcoindet/followers","following_url":"https://api.github.com/users/vcoindet/following{/other_user}","gists_url":"https://api.github.com/users/vcoindet/gists{/gist_id}","starred_url":"https://api.github.com/users/vcoindet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vcoindet/subscriptions","organizations_url":"https://api.github.com/users/vcoindet/orgs","repos_url":"https://api.github.com/users/vcoindet/repos","events_url":"https://api.github.com/users/vcoindet/events{/privacy}","received_events_url":"https://api.github.com/users/vcoindet/received_events","type":"User","site_admin":false},"body":"Doesn't do anything when called in index.html when animation is set to true. (works when animation is set to false)\r\n\r\nWorks fine in console.","created_at":"2017-05-12T08:33:17Z","updated_at":"2017-05-12T08:38:03Z","html_url":"https://github.com/iTowns/itowns2/pull/298#discussion_r116178099","pull_request_url":"https://api.github.com/repos/iTowns/itowns2/pulls/298","_links":{"self":{"href":"https://api.github.com/repos/iTowns/itowns2/pulls/comments/116178099"},"html":{"href":"https://github.com/iTowns/itowns2/pull/298#discussion_r116178099"},"pull_request":{"href":"https://api.github.com/repos/iTowns/itowns2/pulls/298"}}},"pull_request":{"url":"https://api.github.com/repos/iTowns/itowns2/pulls/298","id":119697349,"html_url":"https://github.com/iTowns/itowns2/pull/298","diff_url":"https://github.com/iTowns/itowns2/pull/298.diff","patch_url":"https://github.com/iTowns/itowns2/pull/298.patch","issue_url":"https://api.github.com/repos/iTowns/itowns2/issues/298","number":298,"state":"open","locked":false,"title":"Move controls function to globeControls","user":{"login":"gchoqueux","id":11291849,"avatar_url":"https://avatars0.githubusercontent.com/u/11291849?v=3","gravatar_id":"","url":"https://api.github.com/users/gchoqueux","html_url":"https://github.com/gchoqueux","followers_url":"https://api.github.com/users/gchoqueux/followers","following_url":"https://api.github.com/users/gchoqueux/following{/other_user}","gists_url":"https://api.github.com/users/gchoqueux/gists{/gist_id}","starred_url":"https://api.github.com/users/gchoqueux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gchoqueux/subscriptions","organizations_url":"https://api.github.com/users/gchoqueux/orgs","repos_url":"https://api.github.com/users/gchoqueux/repos","events_url":"https://api.github.com/users/gchoqueux/events{/privacy}","received_events_url":"https://api.github.com/users/gchoqueux/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-05-09T16:15:31Z","updated_at":"2017-05-12T08:38:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0be0b98050f28de0a98de92b9d077f26f77266ec","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/iTowns/itowns2/pulls/298/commits","review_comments_url":"https://api.github.com/repos/iTowns/itowns2/pulls/298/comments","review_comment_url":"https://api.github.com/repos/iTowns/itowns2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iTowns/itowns2/issues/298/comments","statuses_url":"https://api.github.com/repos/iTowns/itowns2/statuses/db68f2968da66257647eabb42c4ff4345ad1dae9","head":{"label":"iTowns:CONTROL","ref":"CONTROL","sha":"db68f2968da66257647eabb42c4ff4345ad1dae9","user":{"login":"iTowns","id":14266889,"avatar_url":"https://avatars1.githubusercontent.com/u/14266889?v=3","gravatar_id":"","url":"https://api.github.com/users/iTowns","html_url":"https://github.com/iTowns","followers_url":"https://api.github.com/users/iTowns/followers","following_url":"https://api.github.com/users/iTowns/following{/other_user}","gists_url":"https://api.github.com/users/iTowns/gists{/gist_id}","starred_url":"https://api.github.com/users/iTowns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iTowns/subscriptions","organizations_url":"https://api.github.com/users/iTowns/orgs","repos_url":"https://api.github.com/users/iTowns/repos","events_url":"https://api.github.com/users/iTowns/events{/privacy}","received_events_url":"https://api.github.com/users/iTowns/received_events","type":"Organization","site_admin":false},"repo":{"id":43068275,"name":"itowns2","full_name":"iTowns/itowns2","owner":{"login":"iTowns","id":14266889,"avatar_url":"https://avatars1.githubusercontent.com/u/14266889?v=3","gravatar_id":"","url":"https://api.github.com/users/iTowns","html_url":"https://github.com/iTowns","followers_url":"https://api.github.com/users/iTowns/followers","following_url":"https://api.github.com/users/iTowns/following{/other_user}","gists_url":"https://api.github.com/users/iTowns/gists{/gist_id}","starred_url":"https://api.github.com/users/iTowns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iTowns/subscriptions","organizations_url":"https://api.github.com/users/iTowns/orgs","repos_url":"https://api.github.com/users/iTowns/repos","events_url":"https://api.github.com/users/iTowns/events{/privacy}","received_events_url":"https://api.github.com/users/iTowns/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iTowns/itowns2","description":"iTowns 2 is the next generation of iTowns, a JS/WebGL framework for 3D geospatial data visualization","fork":false,"url":"https://api.github.com/repos/iTowns/itowns2","forks_url":"https://api.github.com/repos/iTowns/itowns2/forks","keys_url":"https://api.github.com/repos/iTowns/itowns2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iTowns/itowns2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iTowns/itowns2/teams","hooks_url":"https://api.github.com/repos/iTowns/itowns2/hooks","issue_events_url":"https://api.github.com/repos/iTowns/itowns2/issues/events{/number}","events_url":"https://api.github.com/repos/iTowns/itowns2/events","assignees_url":"https://api.github.com/repos/iTowns/itowns2/assignees{/user}","branches_url":"https://api.github.com/repos/iTowns/itowns2/branches{/branch}","tags_url":"https://api.github.com/repos/iTowns/itowns2/tags","blobs_url":"https://api.github.com/repos/iTowns/itowns2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iTowns/itowns2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iTowns/itowns2/git/refs{/sha}","trees_url":"https://api.github.com/repos/iTowns/itowns2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iTowns/itowns2/statuses/{sha}","languages_url":"https://api.github.com/repos/iTowns/itowns2/languages","stargazers_url":"https://api.github.com/repos/iTowns/itowns2/stargazers","contributors_url":"https://api.github.com/repos/iTowns/itowns2/contributors","subscribers_url":"https://api.github.com/repos/iTowns/itowns2/subscribers","subscription_url":"https://api.github.com/repos/iTowns/itowns2/subscription","commits_url":"https://api.github.com/repos/iTowns/itowns2/commits{/sha}","git_commits_url":"https://api.github.com/repos/iTowns/itowns2/git/commits{/sha}","comments_url":"https://api.github.com/repos/iTowns/itowns2/comments{/number}","issue_comment_url":"https://api.github.com/repos/iTowns/itowns2/issues/comments{/number}","contents_url":"https://api.github.com/repos/iTowns/itowns2/contents/{+path}","compare_url":"https://api.github.com/repos/iTowns/itowns2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iTowns/itowns2/merges","archive_url":"https://api.github.com/repos/iTowns/itowns2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iTowns/itowns2/downloads","issues_url":"https://api.github.com/repos/iTowns/itowns2/issues{/number}","pulls_url":"https://api.github.com/repos/iTowns/itowns2/pulls{/number}","milestones_url":"https://api.github.com/repos/iTowns/itowns2/milestones{/number}","notifications_url":"https://api.github.com/repos/iTowns/itowns2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iTowns/itowns2/labels{/name}","releases_url":"https://api.github.com/repos/iTowns/itowns2/releases{/id}","deployments_url":"https://api.github.com/repos/iTowns/itowns2/deployments","created_at":"2015-09-24T13:24:26Z","updated_at":"2017-04-19T13:35:05Z","pushed_at":"2017-05-11T15:54:24Z","git_url":"git://github.com/iTowns/itowns2.git","ssh_url":"git@github.com:iTowns/itowns2.git","clone_url":"https://github.com/iTowns/itowns2.git","svn_url":"https://github.com/iTowns/itowns2","homepage":"","size":89460,"stargazers_count":34,"watchers_count":34,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":23,"mirror_url":null,"open_issues_count":65,"forks":23,"open_issues":65,"watchers":34,"default_branch":"master"}},"base":{"label":"iTowns:master","ref":"master","sha":"d1bc0cd79c1d2bc6261e7bdb6d0ebe5161132828","user":{"login":"iTowns","id":14266889,"avatar_url":"https://avatars1.githubusercontent.com/u/14266889?v=3","gravatar_id":"","url":"https://api.github.com/users/iTowns","html_url":"https://github.com/iTowns","followers_url":"https://api.github.com/users/iTowns/followers","following_url":"https://api.github.com/users/iTowns/following{/other_user}","gists_url":"https://api.github.com/users/iTowns/gists{/gist_id}","starred_url":"https://api.github.com/users/iTowns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iTowns/subscriptions","organizations_url":"https://api.github.com/users/iTowns/orgs","repos_url":"https://api.github.com/users/iTowns/repos","events_url":"https://api.github.com/users/iTowns/events{/privacy}","received_events_url":"https://api.github.com/users/iTowns/received_events","type":"Organization","site_admin":false},"repo":{"id":43068275,"name":"itowns2","full_name":"iTowns/itowns2","owner":{"login":"iTowns","id":14266889,"avatar_url":"https://avatars1.githubusercontent.com/u/14266889?v=3","gravatar_id":"","url":"https://api.github.com/users/iTowns","html_url":"https://github.com/iTowns","followers_url":"https://api.github.com/users/iTowns/followers","following_url":"https://api.github.com/users/iTowns/following{/other_user}","gists_url":"https://api.github.com/users/iTowns/gists{/gist_id}","starred_url":"https://api.github.com/users/iTowns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iTowns/subscriptions","organizations_url":"https://api.github.com/users/iTowns/orgs","repos_url":"https://api.github.com/users/iTowns/repos","events_url":"https://api.github.com/users/iTowns/events{/privacy}","received_events_url":"https://api.github.com/users/iTowns/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iTowns/itowns2","description":"iTowns 2 is the next generation of iTowns, a JS/WebGL framework for 3D geospatial data visualization","fork":false,"url":"https://api.github.com/repos/iTowns/itowns2","forks_url":"https://api.github.com/repos/iTowns/itowns2/forks","keys_url":"https://api.github.com/repos/iTowns/itowns2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iTowns/itowns2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iTowns/itowns2/teams","hooks_url":"https://api.github.com/repos/iTowns/itowns2/hooks","issue_events_url":"https://api.github.com/repos/iTowns/itowns2/issues/events{/number}","events_url":"https://api.github.com/repos/iTowns/itowns2/events","assignees_url":"https://api.github.com/repos/iTowns/itowns2/assignees{/user}","branches_url":"https://api.github.com/repos/iTowns/itowns2/branches{/branch}","tags_url":"https://api.github.com/repos/iTowns/itowns2/tags","blobs_url":"https://api.github.com/repos/iTowns/itowns2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iTowns/itowns2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iTowns/itowns2/git/refs{/sha}","trees_url":"https://api.github.com/repos/iTowns/itowns2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iTowns/itowns2/statuses/{sha}","languages_url":"https://api.github.com/repos/iTowns/itowns2/languages","stargazers_url":"https://api.github.com/repos/iTowns/itowns2/stargazers","contributors_url":"https://api.github.com/repos/iTowns/itowns2/contributors","subscribers_url":"https://api.github.com/repos/iTowns/itowns2/subscribers","subscription_url":"https://api.github.com/repos/iTowns/itowns2/subscription","commits_url":"https://api.github.com/repos/iTowns/itowns2/commits{/sha}","git_commits_url":"https://api.github.com/repos/iTowns/itowns2/git/commits{/sha}","comments_url":"https://api.github.com/repos/iTowns/itowns2/comments{/number}","issue_comment_url":"https://api.github.com/repos/iTowns/itowns2/issues/comments{/number}","contents_url":"https://api.github.com/repos/iTowns/itowns2/contents/{+path}","compare_url":"https://api.github.com/repos/iTowns/itowns2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iTowns/itowns2/merges","archive_url":"https://api.github.com/repos/iTowns/itowns2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iTowns/itowns2/downloads","issues_url":"https://api.github.com/repos/iTowns/itowns2/issues{/number}","pulls_url":"https://api.github.com/repos/iTowns/itowns2/pulls{/number}","milestones_url":"https://api.github.com/repos/iTowns/itowns2/milestones{/number}","notifications_url":"https://api.github.com/repos/iTowns/itowns2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iTowns/itowns2/labels{/name}","releases_url":"https://api.github.com/repos/iTowns/itowns2/releases{/id}","deployments_url":"https://api.github.com/repos/iTowns/itowns2/deployments","created_at":"2015-09-24T13:24:26Z","updated_at":"2017-04-19T13:35:05Z","pushed_at":"2017-05-11T15:54:24Z","git_url":"git://github.com/iTowns/itowns2.git","ssh_url":"git@github.com:iTowns/itowns2.git","clone_url":"https://github.com/iTowns/itowns2.git","svn_url":"https://github.com/iTowns/itowns2","homepage":"","size":89460,"stargazers_count":34,"watchers_count":34,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":23,"mirror_url":null,"open_issues_count":65,"forks":23,"open_issues":65,"watchers":34,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/iTowns/itowns2/pulls/298"},"html":{"href":"https://github.com/iTowns/itowns2/pull/298"},"issue":{"href":"https://api.github.com/repos/iTowns/itowns2/issues/298"},"comments":{"href":"https://api.github.com/repos/iTowns/itowns2/issues/298/comments"},"review_comments":{"href":"https://api.github.com/repos/iTowns/itowns2/pulls/298/comments"},"review_comment":{"href":"https://api.github.com/repos/iTowns/itowns2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iTowns/itowns2/pulls/298/commits"},"statuses":{"href":"https://api.github.com/repos/iTowns/itowns2/statuses/db68f2968da66257647eabb42c4ff4345ad1dae9"}}}}
{"actor":{"display_login":"vcoindet"}}