{"action":"created","comment":{"url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/pulls/comments/207711046","pull_request_review_id":143385216,"id":207711046,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNzcxMTA0Ng==","diff_hunk":"@@ -331,14 +341,79 @@ define([\n     }\n \n     function updateCamera(viewModel, destination) {\n-        viewModel._scene.camera.flyTo({\n-            destination : destination,\n-            complete: function() {\n-                viewModel._complete.raiseEvent();\n-            },\n-            duration : viewModel._flightDuration,\n-            endTransform : Matrix4.IDENTITY\n-        });\n+        var scene = viewModel._scene;\n+        var globe = scene.globe;\n+        var ellipsoid;\n+        if (defined(globe)) {\n+            ellipsoid = globe.ellipsoid;\n+        } else {\n+            ellipsoid = scene.mapProjection.ellipsoid;\n+        }\n+\n+        var camera = scene.camera;\n+        var terrainProvider = scene.terrainProvider;\n+        var availability = defined(terrainProvider) ? terrainProvider.availability : undefined;\n+\n+        // Always expand single points so we don't zoom\n+        // directly into the ground, even when not using terrain.\n+        if (destination instanceof Cartesian3) {\n+            var carto = ellipsoid.cartesianToCartographic(destination);\n+            var offset = CesiumMath.toRadians(0.001);\n+            destination = new Rectangle(\n+                carto.longitude - offset,\n+                carto.latitude - offset,\n+                carto.longitude + offset,\n+                carto.latitude + offset);\n+        }\n+\n+        var newDestination = destination;\n+        if (defined(availability)) {\n+            var cartographics;\n+\n+            cartographics = [","path":"Source/Widgets/Geocoder/GeocoderViewModel.js","position":79,"original_position":79,"commit_id":"fe1a42f4f3569a0d478f3b435319c9a14f38e742","original_commit_id":"fe1a42f4f3569a0d478f3b435319c9a14f38e742","user":{"login":"mramato","id":1495196,"node_id":"MDQ6VXNlcjE0OTUxOTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1495196?v=4","gravatar_id":"","url":"https://api.github.com/users/mramato","html_url":"https://github.com/mramato","followers_url":"https://api.github.com/users/mramato/followers","following_url":"https://api.github.com/users/mramato/following{/other_user}","gists_url":"https://api.github.com/users/mramato/gists{/gist_id}","starred_url":"https://api.github.com/users/mramato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mramato/subscriptions","organizations_url":"https://api.github.com/users/mramato/orgs","repos_url":"https://api.github.com/users/mramato/repos","events_url":"https://api.github.com/users/mramato/events{/privacy}","received_events_url":"https://api.github.com/users/mramato/received_events","type":"User","site_admin":false},"body":"We use result parameters as a necessary evil for performance in hot areas of the code. Not using them makes the code cleaner and is perfectly OK if performance is not going to be an issue.","created_at":"2018-08-04T15:08:34Z","updated_at":"2018-08-04T15:08:34Z","html_url":"https://github.com/AnalyticalGraphicsInc/cesium/pull/6876#discussion_r207711046","pull_request_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/pulls/6876","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/pulls/comments/207711046"},"html":{"href":"https://github.com/AnalyticalGraphicsInc/cesium/pull/6876#discussion_r207711046"},"pull_request":{"href":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/pulls/6876"}},"in_reply_to_id":207655489},"pull_request":{"url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/pulls/6876","id":205807461,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1ODA3NDYx","html_url":"https://github.com/AnalyticalGraphicsInc/cesium/pull/6876","diff_url":"https://github.com/AnalyticalGraphicsInc/cesium/pull/6876.diff","patch_url":"https://github.com/AnalyticalGraphicsInc/cesium/pull/6876.patch","issue_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/6876","number":6876,"state":"closed","locked":false,"title":"Make Geocoder terrain-aware","user":{"login":"mramato","id":1495196,"node_id":"MDQ6VXNlcjE0OTUxOTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1495196?v=4","gravatar_id":"","url":"https://api.github.com/users/mramato","html_url":"https://github.com/mramato","followers_url":"https://api.github.com/users/mramato/followers","following_url":"https://api.github.com/users/mramato/following{/other_user}","gists_url":"https://api.github.com/users/mramato/gists{/gist_id}","starred_url":"https://api.github.com/users/mramato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mramato/subscriptions","organizations_url":"https://api.github.com/users/mramato/orgs","repos_url":"https://api.github.com/users/mramato/repos","events_url":"https://api.github.com/users/mramato/events{/privacy}","received_events_url":"https://api.github.com/users/mramato/received_events","type":"User","site_admin":false},"body":"Previously, if a GeocoderService returned a single point, the geocoder would slam into the ground as close as possible. If the service returned a rectangle, it would only work with when the rectangle height did not include large elevation changes (and slam into the ground otherwise).\r\n\r\nThis change queries the 4 corners and center of the rectangle (if the terrain supports it) and adjusts the geocoder final position height to be above terrain.\r\n\r\nThis is easy to test by zooming to `Grand Canyon, AZ` or `Mount Everest, China` with terrain on.  In master the behavior is terrible.\r\n\r\nWe could eventually pull some of this logic out into a separate helper function, but I figured I'd start small and we can do that if we need to do similar calculations elsewhere.\r\n\r\nFixes #6854","created_at":"2018-08-02T17:28:05Z","updated_at":"2018-08-04T15:08:34Z","closed_at":"2018-08-03T19:48:26Z","merged_at":"2018-08-03T19:48:26Z","merge_commit_sha":"71696ef364789c121f474336f23e51c7b891285d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/pulls/6876/commits","review_comments_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/pulls/6876/comments","review_comment_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/6876/comments","statuses_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/statuses/fe1a42f4f3569a0d478f3b435319c9a14f38e742","head":{"label":"AnalyticalGraphicsInc:geocoder-terrain","ref":"geocoder-terrain","sha":"fe1a42f4f3569a0d478f3b435319c9a14f38e742","user":{"login":"AnalyticalGraphicsInc","id":1490220,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0OTAyMjA=","avatar_url":"https://avatars0.githubusercontent.com/u/1490220?v=4","gravatar_id":"","url":"https://api.github.com/users/AnalyticalGraphicsInc","html_url":"https://github.com/AnalyticalGraphicsInc","followers_url":"https://api.github.com/users/AnalyticalGraphicsInc/followers","following_url":"https://api.github.com/users/AnalyticalGraphicsInc/following{/other_user}","gists_url":"https://api.github.com/users/AnalyticalGraphicsInc/gists{/gist_id}","starred_url":"https://api.github.com/users/AnalyticalGraphicsInc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnalyticalGraphicsInc/subscriptions","organizations_url":"https://api.github.com/users/AnalyticalGraphicsInc/orgs","repos_url":"https://api.github.com/users/AnalyticalGraphicsInc/repos","events_url":"https://api.github.com/users/AnalyticalGraphicsInc/events{/privacy}","received_events_url":"https://api.github.com/users/AnalyticalGraphicsInc/received_events","type":"Organization","site_admin":false},"repo":{"id":3606738,"node_id":"MDEwOlJlcG9zaXRvcnkzNjA2NzM4","name":"cesium","full_name":"AnalyticalGraphicsInc/cesium","owner":{"login":"AnalyticalGraphicsInc","id":1490220,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0OTAyMjA=","avatar_url":"https://avatars0.githubusercontent.com/u/1490220?v=4","gravatar_id":"","url":"https://api.github.com/users/AnalyticalGraphicsInc","html_url":"https://github.com/AnalyticalGraphicsInc","followers_url":"https://api.github.com/users/AnalyticalGraphicsInc/followers","following_url":"https://api.github.com/users/AnalyticalGraphicsInc/following{/other_user}","gists_url":"https://api.github.com/users/AnalyticalGraphicsInc/gists{/gist_id}","starred_url":"https://api.github.com/users/AnalyticalGraphicsInc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnalyticalGraphicsInc/subscriptions","organizations_url":"https://api.github.com/users/AnalyticalGraphicsInc/orgs","repos_url":"https://api.github.com/users/AnalyticalGraphicsInc/repos","events_url":"https://api.github.com/users/AnalyticalGraphicsInc/events{/privacy}","received_events_url":"https://api.github.com/users/AnalyticalGraphicsInc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AnalyticalGraphicsInc/cesium","description":"An open-source JavaScript library for world-class 3D globes and maps :earth_americas:","fork":false,"url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium","forks_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/forks","keys_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/teams","hooks_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/hooks","issue_events_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/events{/number}","events_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/events","assignees_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/assignees{/user}","branches_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/branches{/branch}","tags_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/tags","blobs_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/git/refs{/sha}","trees_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/statuses/{sha}","languages_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/languages","stargazers_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/stargazers","contributors_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/contributors","subscribers_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/subscribers","subscription_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/subscription","commits_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/commits{/sha}","git_commits_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/git/commits{/sha}","comments_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/comments{/number}","issue_comment_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/comments{/number}","contents_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/contents/{+path}","compare_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/merges","archive_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/downloads","issues_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues{/number}","pulls_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/pulls{/number}","milestones_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/milestones{/number}","notifications_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/labels{/name}","releases_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/releases{/id}","deployments_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/deployments","created_at":"2012-03-02T22:27:14Z","updated_at":"2018-08-04T07:59:09Z","pushed_at":"2018-08-04T14:06:42Z","git_url":"git://github.com/AnalyticalGraphicsInc/cesium.git","ssh_url":"git@github.com:AnalyticalGraphicsInc/cesium.git","clone_url":"https://github.com/AnalyticalGraphicsInc/cesium.git","svn_url":"https://github.com/AnalyticalGraphicsInc/cesium","homepage":"http://cesiumjs.org/","size":306360,"stargazers_count":3384,"watchers_count":3384,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1461,"mirror_url":null,"archived":false,"open_issues_count":751,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1461,"open_issues":751,"watchers":3384,"default_branch":"master"}},"base":{"label":"AnalyticalGraphicsInc:master","ref":"master","sha":"c59efc9de6fea8335e11fe647f71613ee36cb737","user":{"login":"AnalyticalGraphicsInc","id":1490220,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0OTAyMjA=","avatar_url":"https://avatars0.githubusercontent.com/u/1490220?v=4","gravatar_id":"","url":"https://api.github.com/users/AnalyticalGraphicsInc","html_url":"https://github.com/AnalyticalGraphicsInc","followers_url":"https://api.github.com/users/AnalyticalGraphicsInc/followers","following_url":"https://api.github.com/users/AnalyticalGraphicsInc/following{/other_user}","gists_url":"https://api.github.com/users/AnalyticalGraphicsInc/gists{/gist_id}","starred_url":"https://api.github.com/users/AnalyticalGraphicsInc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnalyticalGraphicsInc/subscriptions","organizations_url":"https://api.github.com/users/AnalyticalGraphicsInc/orgs","repos_url":"https://api.github.com/users/AnalyticalGraphicsInc/repos","events_url":"https://api.github.com/users/AnalyticalGraphicsInc/events{/privacy}","received_events_url":"https://api.github.com/users/AnalyticalGraphicsInc/received_events","type":"Organization","site_admin":false},"repo":{"id":3606738,"node_id":"MDEwOlJlcG9zaXRvcnkzNjA2NzM4","name":"cesium","full_name":"AnalyticalGraphicsInc/cesium","owner":{"login":"AnalyticalGraphicsInc","id":1490220,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0OTAyMjA=","avatar_url":"https://avatars0.githubusercontent.com/u/1490220?v=4","gravatar_id":"","url":"https://api.github.com/users/AnalyticalGraphicsInc","html_url":"https://github.com/AnalyticalGraphicsInc","followers_url":"https://api.github.com/users/AnalyticalGraphicsInc/followers","following_url":"https://api.github.com/users/AnalyticalGraphicsInc/following{/other_user}","gists_url":"https://api.github.com/users/AnalyticalGraphicsInc/gists{/gist_id}","starred_url":"https://api.github.com/users/AnalyticalGraphicsInc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnalyticalGraphicsInc/subscriptions","organizations_url":"https://api.github.com/users/AnalyticalGraphicsInc/orgs","repos_url":"https://api.github.com/users/AnalyticalGraphicsInc/repos","events_url":"https://api.github.com/users/AnalyticalGraphicsInc/events{/privacy}","received_events_url":"https://api.github.com/users/AnalyticalGraphicsInc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AnalyticalGraphicsInc/cesium","description":"An open-source JavaScript library for world-class 3D globes and maps :earth_americas:","fork":false,"url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium","forks_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/forks","keys_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/teams","hooks_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/hooks","issue_events_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/events{/number}","events_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/events","assignees_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/assignees{/user}","branches_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/branches{/branch}","tags_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/tags","blobs_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/git/refs{/sha}","trees_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/statuses/{sha}","languages_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/languages","stargazers_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/stargazers","contributors_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/contributors","subscribers_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/subscribers","subscription_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/subscription","commits_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/commits{/sha}","git_commits_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/git/commits{/sha}","comments_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/comments{/number}","issue_comment_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/comments{/number}","contents_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/contents/{+path}","compare_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/merges","archive_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/downloads","issues_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues{/number}","pulls_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/pulls{/number}","milestones_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/milestones{/number}","notifications_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/labels{/name}","releases_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/releases{/id}","deployments_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/deployments","created_at":"2012-03-02T22:27:14Z","updated_at":"2018-08-04T07:59:09Z","pushed_at":"2018-08-04T14:06:42Z","git_url":"git://github.com/AnalyticalGraphicsInc/cesium.git","ssh_url":"git@github.com:AnalyticalGraphicsInc/cesium.git","clone_url":"https://github.com/AnalyticalGraphicsInc/cesium.git","svn_url":"https://github.com/AnalyticalGraphicsInc/cesium","homepage":"http://cesiumjs.org/","size":306360,"stargazers_count":3384,"watchers_count":3384,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1461,"mirror_url":null,"archived":false,"open_issues_count":751,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1461,"open_issues":751,"watchers":3384,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/pulls/6876"},"html":{"href":"https://github.com/AnalyticalGraphicsInc/cesium/pull/6876"},"issue":{"href":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/6876"},"comments":{"href":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/6876/comments"},"review_comments":{"href":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/pulls/6876/comments"},"review_comment":{"href":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/pulls/6876/commits"},"statuses":{"href":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/statuses/fe1a42f4f3569a0d478f3b435319c9a14f38e742"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"mramato"}}