{"action":"created","comment":{"url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/comments/93658510","pull_request_review_id":14181146,"id":93658510,"diff_hunk":"@@ -261,10 +284,21 @@ define([\n \n                 // Calculate the length of the line, using a geographic coordindate system\n                 geographicLine = webMercatorUtils.webMercatorToGeographic(line);\n-                var geoLineLength = geodesicUtils.geodesicLengths([geographicLine], options.esriLengthUnits)[0];\n+                var geoLineLength = getLength(geographicLine);\n \n                 // Format the segment and line lengths\n-                tipText = formatTooltip(geoLineLength, _renderedLength + geoLineLength);\n+                var totalLength = _.map(","path":"src/GeositeFramework/js/widgets/map_utils/measure/AgsMeasure.js","position":122,"original_position":122,"commit_id":"4275078d2a25509f457ad1c2295d7b85ace03674","original_commit_id":"4275078d2a25509f457ad1c2295d7b85ace03674","user":{"login":"mmcfarland","id":1014341,"avatar_url":"https://avatars.githubusercontent.com/u/1014341?v=3","gravatar_id":"","url":"https://api.github.com/users/mmcfarland","html_url":"https://github.com/mmcfarland","followers_url":"https://api.github.com/users/mmcfarland/followers","following_url":"https://api.github.com/users/mmcfarland/following{/other_user}","gists_url":"https://api.github.com/users/mmcfarland/gists{/gist_id}","starred_url":"https://api.github.com/users/mmcfarland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmcfarland/subscriptions","organizations_url":"https://api.github.com/users/mmcfarland/orgs","repos_url":"https://api.github.com/users/mmcfarland/repos","events_url":"https://api.github.com/users/mmcfarland/events{/privacy}","received_events_url":"https://api.github.com/users/mmcfarland/received_events","type":"User","site_admin":false},"body":"I find this block pretty terse and hard to follow.  Breaking it down to component parts is about equivilent length but much better to read, in my opinion.  Along the lines of\r\n```js\r\n                var units = _.map(options.esriLengthUnits, function(unit) {\r\n                        return _unitsLookup[unit];\r\n                    }),\r\n                    allSegments = _renderedLength.concat(geoLineLength),\r\n                    totalLength = _.map(units, function(unit) {\r\n                        return {\r\n                            uom: unit,\r\n                            length: sum(_.where(allSegments, { uom: unit }))\r\n                        };\r\n                    });\r\n                function sum(arr) {\r\n                    return _.reduce(arr, function (x, y) { return x + y.length; }, 0)\r\n                }\r\n```\r\n","created_at":"2016-12-22T16:53:05Z","updated_at":"2016-12-22T17:01:01Z","html_url":"https://github.com/CoastalResilienceNetwork/GeositeFramework/pull/806#discussion_r93658510","pull_request_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/806","_links":{"self":{"href":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/comments/93658510"},"html":{"href":"https://github.com/CoastalResilienceNetwork/GeositeFramework/pull/806#discussion_r93658510"},"pull_request":{"href":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/806"}}},"pull_request":{"url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/806","id":99012459,"html_url":"https://github.com/CoastalResilienceNetwork/GeositeFramework/pull/806","diff_url":"https://github.com/CoastalResilienceNetwork/GeositeFramework/pull/806.diff","patch_url":"https://github.com/CoastalResilienceNetwork/GeositeFramework/pull/806.patch","issue_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues/806","number":806,"state":"open","locked":false,"title":"Add more UoM and associated values to measure tool","user":{"login":"jtarricone","id":18290666,"avatar_url":"https://avatars.githubusercontent.com/u/18290666?v=3","gravatar_id":"","url":"https://api.github.com/users/jtarricone","html_url":"https://github.com/jtarricone","followers_url":"https://api.github.com/users/jtarricone/followers","following_url":"https://api.github.com/users/jtarricone/following{/other_user}","gists_url":"https://api.github.com/users/jtarricone/gists{/gist_id}","starred_url":"https://api.github.com/users/jtarricone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtarricone/subscriptions","organizations_url":"https://api.github.com/users/jtarricone/orgs","repos_url":"https://api.github.com/users/jtarricone/repos","events_url":"https://api.github.com/users/jtarricone/events{/privacy}","received_events_url":"https://api.github.com/users/jtarricone/received_events","type":"User","site_admin":false},"body":"Adds metric equivalent measurements to the output of the measuring tool, for length and area. Also adds acres/hectares to the area measurement.\r\n\r\nTo test:\r\n* clone this branch and open the app\r\n* activate the measuring tool\r\n* when measuring, check that the metric equivalent value is displayed and is accurate\r\n* check that the segment- and total-length measurements look correct, i.e. the total >= segment\r\n* create a polygon and check that the area is now shown in square miles/kilometers and acres/hectares\r\n\r\nConnects #784 ","created_at":"2016-12-21T22:01:18Z","updated_at":"2016-12-22T17:01:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"660cdf2623cd1a023581ae931900d449ac39f107","assignee":{"login":"mmcfarland","id":1014341,"avatar_url":"https://avatars.githubusercontent.com/u/1014341?v=3","gravatar_id":"","url":"https://api.github.com/users/mmcfarland","html_url":"https://github.com/mmcfarland","followers_url":"https://api.github.com/users/mmcfarland/followers","following_url":"https://api.github.com/users/mmcfarland/following{/other_user}","gists_url":"https://api.github.com/users/mmcfarland/gists{/gist_id}","starred_url":"https://api.github.com/users/mmcfarland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmcfarland/subscriptions","organizations_url":"https://api.github.com/users/mmcfarland/orgs","repos_url":"https://api.github.com/users/mmcfarland/repos","events_url":"https://api.github.com/users/mmcfarland/events{/privacy}","received_events_url":"https://api.github.com/users/mmcfarland/received_events","type":"User","site_admin":false},"assignees":[{"login":"mmcfarland","id":1014341,"avatar_url":"https://avatars.githubusercontent.com/u/1014341?v=3","gravatar_id":"","url":"https://api.github.com/users/mmcfarland","html_url":"https://github.com/mmcfarland","followers_url":"https://api.github.com/users/mmcfarland/followers","following_url":"https://api.github.com/users/mmcfarland/following{/other_user}","gists_url":"https://api.github.com/users/mmcfarland/gists{/gist_id}","starred_url":"https://api.github.com/users/mmcfarland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmcfarland/subscriptions","organizations_url":"https://api.github.com/users/mmcfarland/orgs","repos_url":"https://api.github.com/users/mmcfarland/repos","events_url":"https://api.github.com/users/mmcfarland/events{/privacy}","received_events_url":"https://api.github.com/users/mmcfarland/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/806/commits","review_comments_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/806/comments","review_comment_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues/806/comments","statuses_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/statuses/4275078d2a25509f457ad1c2295d7b85ace03674","head":{"label":"CoastalResilienceNetwork:jmt/add-metric-units-to-measure-tool","ref":"jmt/add-metric-units-to-measure-tool","sha":"4275078d2a25509f457ad1c2295d7b85ace03674","user":{"login":"CoastalResilienceNetwork","id":5659174,"avatar_url":"https://avatars.githubusercontent.com/u/5659174?v=3","gravatar_id":"","url":"https://api.github.com/users/CoastalResilienceNetwork","html_url":"https://github.com/CoastalResilienceNetwork","followers_url":"https://api.github.com/users/CoastalResilienceNetwork/followers","following_url":"https://api.github.com/users/CoastalResilienceNetwork/following{/other_user}","gists_url":"https://api.github.com/users/CoastalResilienceNetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/CoastalResilienceNetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CoastalResilienceNetwork/subscriptions","organizations_url":"https://api.github.com/users/CoastalResilienceNetwork/orgs","repos_url":"https://api.github.com/users/CoastalResilienceNetwork/repos","events_url":"https://api.github.com/users/CoastalResilienceNetwork/events{/privacy}","received_events_url":"https://api.github.com/users/CoastalResilienceNetwork/received_events","type":"Organization","site_admin":false},"repo":{"id":7753400,"name":"GeositeFramework","full_name":"CoastalResilienceNetwork/GeositeFramework","owner":{"login":"CoastalResilienceNetwork","id":5659174,"avatar_url":"https://avatars.githubusercontent.com/u/5659174?v=3","gravatar_id":"","url":"https://api.github.com/users/CoastalResilienceNetwork","html_url":"https://github.com/CoastalResilienceNetwork","followers_url":"https://api.github.com/users/CoastalResilienceNetwork/followers","following_url":"https://api.github.com/users/CoastalResilienceNetwork/following{/other_user}","gists_url":"https://api.github.com/users/CoastalResilienceNetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/CoastalResilienceNetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CoastalResilienceNetwork/subscriptions","organizations_url":"https://api.github.com/users/CoastalResilienceNetwork/orgs","repos_url":"https://api.github.com/users/CoastalResilienceNetwork/repos","events_url":"https://api.github.com/users/CoastalResilienceNetwork/events{/privacy}","received_events_url":"https://api.github.com/users/CoastalResilienceNetwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CoastalResilienceNetwork/GeositeFramework","description":"Mapping Framework powering TNC Coastal Resilience programs","fork":false,"url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework","forks_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/forks","keys_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/teams","hooks_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/hooks","issue_events_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues/events{/number}","events_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/events","assignees_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/assignees{/user}","branches_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/branches{/branch}","tags_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/tags","blobs_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/git/refs{/sha}","trees_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/statuses/{sha}","languages_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/languages","stargazers_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/stargazers","contributors_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/contributors","subscribers_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/subscribers","subscription_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/subscription","commits_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/commits{/sha}","git_commits_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/git/commits{/sha}","comments_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/comments{/number}","issue_comment_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues/comments{/number}","contents_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/contents/{+path}","compare_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/merges","archive_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/downloads","issues_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues{/number}","pulls_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls{/number}","milestones_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/milestones{/number}","notifications_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/labels{/name}","releases_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/releases{/id}","deployments_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/deployments","created_at":"2013-01-22T14:07:50Z","updated_at":"2016-12-12T23:32:22Z","pushed_at":"2016-12-21T22:19:11Z","git_url":"git://github.com/CoastalResilienceNetwork/GeositeFramework.git","ssh_url":"git@github.com:CoastalResilienceNetwork/GeositeFramework.git","clone_url":"https://github.com/CoastalResilienceNetwork/GeositeFramework.git","svn_url":"https://github.com/CoastalResilienceNetwork/GeositeFramework","homepage":"http://maps.coastalresilience.org/network/","size":9174,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":60,"forks":8,"open_issues":60,"watchers":7,"default_branch":"master"}},"base":{"label":"CoastalResilienceNetwork:prototype","ref":"prototype","sha":"aa9f456d66e0f4c7c77367134da196601e41bf9a","user":{"login":"CoastalResilienceNetwork","id":5659174,"avatar_url":"https://avatars.githubusercontent.com/u/5659174?v=3","gravatar_id":"","url":"https://api.github.com/users/CoastalResilienceNetwork","html_url":"https://github.com/CoastalResilienceNetwork","followers_url":"https://api.github.com/users/CoastalResilienceNetwork/followers","following_url":"https://api.github.com/users/CoastalResilienceNetwork/following{/other_user}","gists_url":"https://api.github.com/users/CoastalResilienceNetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/CoastalResilienceNetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CoastalResilienceNetwork/subscriptions","organizations_url":"https://api.github.com/users/CoastalResilienceNetwork/orgs","repos_url":"https://api.github.com/users/CoastalResilienceNetwork/repos","events_url":"https://api.github.com/users/CoastalResilienceNetwork/events{/privacy}","received_events_url":"https://api.github.com/users/CoastalResilienceNetwork/received_events","type":"Organization","site_admin":false},"repo":{"id":7753400,"name":"GeositeFramework","full_name":"CoastalResilienceNetwork/GeositeFramework","owner":{"login":"CoastalResilienceNetwork","id":5659174,"avatar_url":"https://avatars.githubusercontent.com/u/5659174?v=3","gravatar_id":"","url":"https://api.github.com/users/CoastalResilienceNetwork","html_url":"https://github.com/CoastalResilienceNetwork","followers_url":"https://api.github.com/users/CoastalResilienceNetwork/followers","following_url":"https://api.github.com/users/CoastalResilienceNetwork/following{/other_user}","gists_url":"https://api.github.com/users/CoastalResilienceNetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/CoastalResilienceNetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CoastalResilienceNetwork/subscriptions","organizations_url":"https://api.github.com/users/CoastalResilienceNetwork/orgs","repos_url":"https://api.github.com/users/CoastalResilienceNetwork/repos","events_url":"https://api.github.com/users/CoastalResilienceNetwork/events{/privacy}","received_events_url":"https://api.github.com/users/CoastalResilienceNetwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CoastalResilienceNetwork/GeositeFramework","description":"Mapping Framework powering TNC Coastal Resilience programs","fork":false,"url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework","forks_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/forks","keys_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/teams","hooks_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/hooks","issue_events_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues/events{/number}","events_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/events","assignees_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/assignees{/user}","branches_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/branches{/branch}","tags_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/tags","blobs_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/git/refs{/sha}","trees_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/statuses/{sha}","languages_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/languages","stargazers_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/stargazers","contributors_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/contributors","subscribers_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/subscribers","subscription_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/subscription","commits_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/commits{/sha}","git_commits_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/git/commits{/sha}","comments_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/comments{/number}","issue_comment_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues/comments{/number}","contents_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/contents/{+path}","compare_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/merges","archive_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/downloads","issues_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues{/number}","pulls_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls{/number}","milestones_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/milestones{/number}","notifications_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/labels{/name}","releases_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/releases{/id}","deployments_url":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/deployments","created_at":"2013-01-22T14:07:50Z","updated_at":"2016-12-12T23:32:22Z","pushed_at":"2016-12-21T22:19:11Z","git_url":"git://github.com/CoastalResilienceNetwork/GeositeFramework.git","ssh_url":"git@github.com:CoastalResilienceNetwork/GeositeFramework.git","clone_url":"https://github.com/CoastalResilienceNetwork/GeositeFramework.git","svn_url":"https://github.com/CoastalResilienceNetwork/GeositeFramework","homepage":"http://maps.coastalresilience.org/network/","size":9174,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":60,"forks":8,"open_issues":60,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/806"},"html":{"href":"https://github.com/CoastalResilienceNetwork/GeositeFramework/pull/806"},"issue":{"href":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues/806"},"comments":{"href":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/issues/806/comments"},"review_comments":{"href":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/806/comments"},"review_comment":{"href":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/pulls/806/commits"},"statuses":{"href":"https://api.github.com/repos/CoastalResilienceNetwork/GeositeFramework/statuses/4275078d2a25509f457ad1c2295d7b85ace03674"}}}}
{"actor":{"display_login":"mmcfarland"}}