{"action":"created","comment":{"url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/comments/37846136","id":37846136,"diff_hunk":"@@ -80,6 +81,40 @@ goog.require('ga_permalink');\n \n             map.setTarget(element[0]);\n \n+            scope.$watch('::ol3d', function(ol3d) {\n+              if (ol3d) {\n+                var camera = ol3d.getCesiumScene().camera;\n+                var params = gaPermalink.getParams();\n+\n+                // initial location based on query params\n+                var position = undefined;\n+                if (params.lon && params.lat && params.elevation) {\n+                  var lon = parseFloat(params.lon);\n+                  var lat = parseFloat(params.lat);\n+                  var elevation = parseFloat(params.elevation);\n+                  position = new Cesium.Cartographic(lon, lat, elevation);\n+                }\n+                camera.setView({\n+                  positionCartographic: position,\n+                  heading: params.heading ? parseFloat(params.heading) : undefined,\n+                  pitch: params.pitch ? parseFloat(params.pitch) : undefined,\n+                  roll: 0.0\n+                });\n+\n+                // update permalink\n+                camera.moveEnd.addEventListener(function() {","path":"src/components/map/MapDirective.js","position":72,"original_position":35,"commit_id":"138c612781a5ff76072775f30ced597b07ed1e98","original_commit_id":"a4c79967b3be47adbae6e814828173f50c919010","user":{"login":"elemoine","id":76594,"avatar_url":"https://avatars.githubusercontent.com/u/76594?v=3","gravatar_id":"","url":"https://api.github.com/users/elemoine","html_url":"https://github.com/elemoine","followers_url":"https://api.github.com/users/elemoine/followers","following_url":"https://api.github.com/users/elemoine/following{/other_user}","gists_url":"https://api.github.com/users/elemoine/gists{/gist_id}","starred_url":"https://api.github.com/users/elemoine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elemoine/subscriptions","organizations_url":"https://api.github.com/users/elemoine/orgs","repos_url":"https://api.github.com/users/elemoine/repos","events_url":"https://api.github.com/users/elemoine/events{/privacy}","received_events_url":"https://api.github.com/users/elemoine/received_events","type":"User","site_admin":false},"body":"This is a good point. @fredj, have you verified how often the listener is called? `gaDebounce` is already used for the update of the 2D map parameters, so it probably makes sense to do the same for the 3D params.","created_at":"2015-08-25T09:03:15Z","updated_at":"2015-08-25T09:03:15Z","html_url":"https://github.com/geoadmin/mf-geoadmin3/pull/2593#discussion_r37846136","pull_request_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2593","_links":{"self":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/comments/37846136"},"html":{"href":"https://github.com/geoadmin/mf-geoadmin3/pull/2593#discussion_r37846136"},"pull_request":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2593"}}},"pull_request":{"url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2593","id":42826199,"html_url":"https://github.com/geoadmin/mf-geoadmin3/pull/2593","diff_url":"https://github.com/geoadmin/mf-geoadmin3/pull/2593.diff","patch_url":"https://github.com/geoadmin/mf-geoadmin3/pull/2593.patch","issue_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/2593","number":2593,"state":"open","locked":false,"title":"[3D] Add 3d params to the permalink","user":{"login":"fredj","id":100959,"avatar_url":"https://avatars.githubusercontent.com/u/100959?v=3","gravatar_id":"","url":"https://api.github.com/users/fredj","html_url":"https://github.com/fredj","followers_url":"https://api.github.com/users/fredj/followers","following_url":"https://api.github.com/users/fredj/following{/other_user}","gists_url":"https://api.github.com/users/fredj/gists{/gist_id}","starred_url":"https://api.github.com/users/fredj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredj/subscriptions","organizations_url":"https://api.github.com/users/fredj/orgs","repos_url":"https://api.github.com/users/fredj/repos","events_url":"https://api.github.com/users/fredj/events{/privacy}","received_events_url":"https://api.github.com/users/fredj/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-19T15:11:41Z","updated_at":"2015-08-25T09:03:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"51f71d162023e8e212e097e8d15d124b0278d905","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2593/commits","review_comments_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2593/comments","review_comment_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/2593/comments","statuses_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/statuses/138c612781a5ff76072775f30ced597b07ed1e98","head":{"label":"geoadmin:3d_permalink","ref":"3d_permalink","sha":"138c612781a5ff76072775f30ced597b07ed1e98","user":{"login":"geoadmin","id":3369793,"avatar_url":"https://avatars.githubusercontent.com/u/3369793?v=3","gravatar_id":"","url":"https://api.github.com/users/geoadmin","html_url":"https://github.com/geoadmin","followers_url":"https://api.github.com/users/geoadmin/followers","following_url":"https://api.github.com/users/geoadmin/following{/other_user}","gists_url":"https://api.github.com/users/geoadmin/gists{/gist_id}","starred_url":"https://api.github.com/users/geoadmin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoadmin/subscriptions","organizations_url":"https://api.github.com/users/geoadmin/orgs","repos_url":"https://api.github.com/users/geoadmin/repos","events_url":"https://api.github.com/users/geoadmin/events{/privacy}","received_events_url":"https://api.github.com/users/geoadmin/received_events","type":"Organization","site_admin":false},"repo":{"id":10399273,"name":"mf-geoadmin3","full_name":"geoadmin/mf-geoadmin3","owner":{"login":"geoadmin","id":3369793,"avatar_url":"https://avatars.githubusercontent.com/u/3369793?v=3","gravatar_id":"","url":"https://api.github.com/users/geoadmin","html_url":"https://github.com/geoadmin","followers_url":"https://api.github.com/users/geoadmin/followers","following_url":"https://api.github.com/users/geoadmin/following{/other_user}","gists_url":"https://api.github.com/users/geoadmin/gists{/gist_id}","starred_url":"https://api.github.com/users/geoadmin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoadmin/subscriptions","organizations_url":"https://api.github.com/users/geoadmin/orgs","repos_url":"https://api.github.com/users/geoadmin/repos","events_url":"https://api.github.com/users/geoadmin/events{/privacy}","received_events_url":"https://api.github.com/users/geoadmin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geoadmin/mf-geoadmin3","description":"map.geo.admin.ch source code","fork":false,"url":"https://api.github.com/repos/geoadmin/mf-geoadmin3","forks_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/forks","keys_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/teams","hooks_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/hooks","issue_events_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/events{/number}","events_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/events","assignees_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/assignees{/user}","branches_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/branches{/branch}","tags_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/tags","blobs_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/refs{/sha}","trees_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/statuses/{sha}","languages_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/languages","stargazers_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/stargazers","contributors_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/contributors","subscribers_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/subscribers","subscription_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/subscription","commits_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/commits{/sha}","git_commits_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/commits{/sha}","comments_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/comments{/number}","issue_comment_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/comments{/number}","contents_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/contents/{+path}","compare_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/merges","archive_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/downloads","issues_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues{/number}","pulls_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls{/number}","milestones_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/milestones{/number}","notifications_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/labels{/name}","releases_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/releases{/id}","created_at":"2013-05-31T06:37:20Z","updated_at":"2015-08-24T12:27:21Z","pushed_at":"2015-08-25T09:02:24Z","git_url":"git://github.com/geoadmin/mf-geoadmin3.git","ssh_url":"git@github.com:geoadmin/mf-geoadmin3.git","clone_url":"https://github.com/geoadmin/mf-geoadmin3.git","svn_url":"https://github.com/geoadmin/mf-geoadmin3","homepage":"http://map.geo.admin.ch","size":48639,"stargazers_count":73,"watchers_count":73,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":87,"forks":35,"open_issues":87,"watchers":73,"default_branch":"master"}},"base":{"label":"geoadmin:master","ref":"master","sha":"ddbb9974447d94b5382fd55e9524d112eca28ed9","user":{"login":"geoadmin","id":3369793,"avatar_url":"https://avatars.githubusercontent.com/u/3369793?v=3","gravatar_id":"","url":"https://api.github.com/users/geoadmin","html_url":"https://github.com/geoadmin","followers_url":"https://api.github.com/users/geoadmin/followers","following_url":"https://api.github.com/users/geoadmin/following{/other_user}","gists_url":"https://api.github.com/users/geoadmin/gists{/gist_id}","starred_url":"https://api.github.com/users/geoadmin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoadmin/subscriptions","organizations_url":"https://api.github.com/users/geoadmin/orgs","repos_url":"https://api.github.com/users/geoadmin/repos","events_url":"https://api.github.com/users/geoadmin/events{/privacy}","received_events_url":"https://api.github.com/users/geoadmin/received_events","type":"Organization","site_admin":false},"repo":{"id":10399273,"name":"mf-geoadmin3","full_name":"geoadmin/mf-geoadmin3","owner":{"login":"geoadmin","id":3369793,"avatar_url":"https://avatars.githubusercontent.com/u/3369793?v=3","gravatar_id":"","url":"https://api.github.com/users/geoadmin","html_url":"https://github.com/geoadmin","followers_url":"https://api.github.com/users/geoadmin/followers","following_url":"https://api.github.com/users/geoadmin/following{/other_user}","gists_url":"https://api.github.com/users/geoadmin/gists{/gist_id}","starred_url":"https://api.github.com/users/geoadmin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoadmin/subscriptions","organizations_url":"https://api.github.com/users/geoadmin/orgs","repos_url":"https://api.github.com/users/geoadmin/repos","events_url":"https://api.github.com/users/geoadmin/events{/privacy}","received_events_url":"https://api.github.com/users/geoadmin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geoadmin/mf-geoadmin3","description":"map.geo.admin.ch source code","fork":false,"url":"https://api.github.com/repos/geoadmin/mf-geoadmin3","forks_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/forks","keys_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/teams","hooks_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/hooks","issue_events_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/events{/number}","events_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/events","assignees_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/assignees{/user}","branches_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/branches{/branch}","tags_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/tags","blobs_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/refs{/sha}","trees_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/statuses/{sha}","languages_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/languages","stargazers_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/stargazers","contributors_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/contributors","subscribers_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/subscribers","subscription_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/subscription","commits_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/commits{/sha}","git_commits_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/git/commits{/sha}","comments_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/comments{/number}","issue_comment_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/comments{/number}","contents_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/contents/{+path}","compare_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/merges","archive_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/downloads","issues_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues{/number}","pulls_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls{/number}","milestones_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/milestones{/number}","notifications_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/labels{/name}","releases_url":"https://api.github.com/repos/geoadmin/mf-geoadmin3/releases{/id}","created_at":"2013-05-31T06:37:20Z","updated_at":"2015-08-24T12:27:21Z","pushed_at":"2015-08-25T09:02:24Z","git_url":"git://github.com/geoadmin/mf-geoadmin3.git","ssh_url":"git@github.com:geoadmin/mf-geoadmin3.git","clone_url":"https://github.com/geoadmin/mf-geoadmin3.git","svn_url":"https://github.com/geoadmin/mf-geoadmin3","homepage":"http://map.geo.admin.ch","size":48639,"stargazers_count":73,"watchers_count":73,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":87,"forks":35,"open_issues":87,"watchers":73,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2593"},"html":{"href":"https://github.com/geoadmin/mf-geoadmin3/pull/2593"},"issue":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/2593"},"comments":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/issues/2593/comments"},"review_comments":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2593/comments"},"review_comment":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/pulls/2593/commits"},"statuses":{"href":"https://api.github.com/repos/geoadmin/mf-geoadmin3/statuses/138c612781a5ff76072775f30ced597b07ed1e98"}}}}