{"action":"created","comment":{"url":"https://api.github.com/repos/openlayers/ol3/pulls/comments/43035138","id":43035138,"diff_hunk":"@@ -1,10 +1,12 @@\n ---\n template: example.html\n title: Measure example\n-shortdesc: Example of using the ol.interaction.Draw interaction for creating simple measuring application.\n+shortdesc: Example of using the ol.interaction.Draw interaction for creating a simple measuring application.\n docs: >\n-  <p><i>NOTE: If use geodesic measures is not checked, measure is done in simple way on projected plane. Earth curvature is not taken into account</i></p>\n-tags: \"draw, edit, measure, vector\"\n+  <p><i>NOTE: Area and length calculations are done using ol.proj.getLength and ol.proj.getArea to get answers in meters or square meters at any latitude.\n+  The ol.geom.Linestring.getLength method does not give a length in meters for EPSG:3857 or EPSG:4326 linestrings.","path":"examples/measure.html","position":10,"original_position":10,"commit_id":"de567fdaebd815413325ce9725d94ef4164d0790","original_commit_id":"de567fdaebd815413325ce9725d94ef4164d0790","user":{"login":"ahocevar","id":211514,"avatar_url":"https://avatars.githubusercontent.com/u/211514?v=3","gravatar_id":"","url":"https://api.github.com/users/ahocevar","html_url":"https://github.com/ahocevar","followers_url":"https://api.github.com/users/ahocevar/followers","following_url":"https://api.github.com/users/ahocevar/following{/other_user}","gists_url":"https://api.github.com/users/ahocevar/gists{/gist_id}","starred_url":"https://api.github.com/users/ahocevar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahocevar/subscriptions","organizations_url":"https://api.github.com/users/ahocevar/orgs","repos_url":"https://api.github.com/users/ahocevar/repos","events_url":"https://api.github.com/users/ahocevar/events{/privacy}","received_events_url":"https://api.github.com/users/ahocevar/received_events","type":"User","site_admin":false},"body":"I had misread your example documentation above, and thought you were talking about the new functions. Maybe just remove that note.","created_at":"2015-10-26T18:43:56Z","updated_at":"2015-10-26T18:43:56Z","html_url":"https://github.com/openlayers/ol3/pull/4311#discussion_r43035138","pull_request_url":"https://api.github.com/repos/openlayers/ol3/pulls/4311","_links":{"self":{"href":"https://api.github.com/repos/openlayers/ol3/pulls/comments/43035138"},"html":{"href":"https://github.com/openlayers/ol3/pull/4311#discussion_r43035138"},"pull_request":{"href":"https://api.github.com/repos/openlayers/ol3/pulls/4311"}}},"pull_request":{"url":"https://api.github.com/repos/openlayers/ol3/pulls/4311","id":48659748,"html_url":"https://github.com/openlayers/ol3/pull/4311","diff_url":"https://github.com/openlayers/ol3/pull/4311.diff","patch_url":"https://github.com/openlayers/ol3/pull/4311.patch","issue_url":"https://api.github.com/repos/openlayers/ol3/issues/4311","number":4311,"state":"open","locked":false,"title":"Add useful getLength and getArea methods to ol.proj","user":{"login":"bill-chadwick","id":10521516,"avatar_url":"https://avatars.githubusercontent.com/u/10521516?v=3","gravatar_id":"","url":"https://api.github.com/users/bill-chadwick","html_url":"https://github.com/bill-chadwick","followers_url":"https://api.github.com/users/bill-chadwick/followers","following_url":"https://api.github.com/users/bill-chadwick/following{/other_user}","gists_url":"https://api.github.com/users/bill-chadwick/gists{/gist_id}","starred_url":"https://api.github.com/users/bill-chadwick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bill-chadwick/subscriptions","organizations_url":"https://api.github.com/users/bill-chadwick/orgs","repos_url":"https://api.github.com/users/bill-chadwick/repos","events_url":"https://api.github.com/users/bill-chadwick/events{/privacy}","received_events_url":"https://api.github.com/users/bill-chadwick/received_events","type":"User","site_admin":false},"body":"Useful linestring getLength and polygon getArea methods are added to ol.proj and the measure example is updated to use them.\r\n\r\nThe new methods give good answers in metres, pixels or other projection units whatever the latitude, and whatever the projection. Results in metres and metres squared are returned for EPSG:4326 and EPSG:3857. An optional ol.Sphere can be specified, which might be used for example, with non terrestrial mapping.\r\n\r\nThe custom getPointResolution function attribute of ol.proj is replaced with a boolean constantPointResolution attribute, with a getter and setter in ol.proj. constantPointResolution should be set true for projections such as UTM or EPSG:27700, which have nominally constant scale throughout their extent, either at construction time, or afterwards. constantPointResolution will default to false unless the projection's units are pixels or degrees, in which case it is set true. ol.proj.getPointResolution will return an unchanged resolution for constantPointResolution projections. When constantPointResolution is true and projection units are not degrees, length and area calculations can use simple, fast and accurate planar cartesian methods rather than spherical methods.\r\n\r\nDocumentation warnings are added to ol.geom getLength and getArea methods which for EPSG:3857 and EPSG:4326 do not return results in metres or metres squared. Also, a warning is added to the documentation of ol.geom.circle about the radius not being in metres.\r\n\r\nTest for the new ol.proj methods are included.\r\n\r\nI have had a go and squashing my commits into one but have failed - sorry.","created_at":"2015-10-24T16:42:33Z","updated_at":"2015-10-26T18:43:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"26ca96f54b7c97f097738db05826ca91a6eab1e9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openlayers/ol3/pulls/4311/commits","review_comments_url":"https://api.github.com/repos/openlayers/ol3/pulls/4311/comments","review_comment_url":"https://api.github.com/repos/openlayers/ol3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openlayers/ol3/issues/4311/comments","statuses_url":"https://api.github.com/repos/openlayers/ol3/statuses/de567fdaebd815413325ce9725d94ef4164d0790","head":{"label":"bill-chadwick:getLength","ref":"getLength","sha":"de567fdaebd815413325ce9725d94ef4164d0790","user":{"login":"bill-chadwick","id":10521516,"avatar_url":"https://avatars.githubusercontent.com/u/10521516?v=3","gravatar_id":"","url":"https://api.github.com/users/bill-chadwick","html_url":"https://github.com/bill-chadwick","followers_url":"https://api.github.com/users/bill-chadwick/followers","following_url":"https://api.github.com/users/bill-chadwick/following{/other_user}","gists_url":"https://api.github.com/users/bill-chadwick/gists{/gist_id}","starred_url":"https://api.github.com/users/bill-chadwick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bill-chadwick/subscriptions","organizations_url":"https://api.github.com/users/bill-chadwick/orgs","repos_url":"https://api.github.com/users/bill-chadwick/repos","events_url":"https://api.github.com/users/bill-chadwick/events{/privacy}","received_events_url":"https://api.github.com/users/bill-chadwick/received_events","type":"User","site_admin":false},"repo":{"id":31778667,"name":"ol3","full_name":"bill-chadwick/ol3","owner":{"login":"bill-chadwick","id":10521516,"avatar_url":"https://avatars.githubusercontent.com/u/10521516?v=3","gravatar_id":"","url":"https://api.github.com/users/bill-chadwick","html_url":"https://github.com/bill-chadwick","followers_url":"https://api.github.com/users/bill-chadwick/followers","following_url":"https://api.github.com/users/bill-chadwick/following{/other_user}","gists_url":"https://api.github.com/users/bill-chadwick/gists{/gist_id}","starred_url":"https://api.github.com/users/bill-chadwick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bill-chadwick/subscriptions","organizations_url":"https://api.github.com/users/bill-chadwick/orgs","repos_url":"https://api.github.com/users/bill-chadwick/repos","events_url":"https://api.github.com/users/bill-chadwick/events{/privacy}","received_events_url":"https://api.github.com/users/bill-chadwick/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bill-chadwick/ol3","description":"OpenLayers 3","fork":true,"url":"https://api.github.com/repos/bill-chadwick/ol3","forks_url":"https://api.github.com/repos/bill-chadwick/ol3/forks","keys_url":"https://api.github.com/repos/bill-chadwick/ol3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bill-chadwick/ol3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bill-chadwick/ol3/teams","hooks_url":"https://api.github.com/repos/bill-chadwick/ol3/hooks","issue_events_url":"https://api.github.com/repos/bill-chadwick/ol3/issues/events{/number}","events_url":"https://api.github.com/repos/bill-chadwick/ol3/events","assignees_url":"https://api.github.com/repos/bill-chadwick/ol3/assignees{/user}","branches_url":"https://api.github.com/repos/bill-chadwick/ol3/branches{/branch}","tags_url":"https://api.github.com/repos/bill-chadwick/ol3/tags","blobs_url":"https://api.github.com/repos/bill-chadwick/ol3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bill-chadwick/ol3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bill-chadwick/ol3/git/refs{/sha}","trees_url":"https://api.github.com/repos/bill-chadwick/ol3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bill-chadwick/ol3/statuses/{sha}","languages_url":"https://api.github.com/repos/bill-chadwick/ol3/languages","stargazers_url":"https://api.github.com/repos/bill-chadwick/ol3/stargazers","contributors_url":"https://api.github.com/repos/bill-chadwick/ol3/contributors","subscribers_url":"https://api.github.com/repos/bill-chadwick/ol3/subscribers","subscription_url":"https://api.github.com/repos/bill-chadwick/ol3/subscription","commits_url":"https://api.github.com/repos/bill-chadwick/ol3/commits{/sha}","git_commits_url":"https://api.github.com/repos/bill-chadwick/ol3/git/commits{/sha}","comments_url":"https://api.github.com/repos/bill-chadwick/ol3/comments{/number}","issue_comment_url":"https://api.github.com/repos/bill-chadwick/ol3/issues/comments{/number}","contents_url":"https://api.github.com/repos/bill-chadwick/ol3/contents/{+path}","compare_url":"https://api.github.com/repos/bill-chadwick/ol3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bill-chadwick/ol3/merges","archive_url":"https://api.github.com/repos/bill-chadwick/ol3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bill-chadwick/ol3/downloads","issues_url":"https://api.github.com/repos/bill-chadwick/ol3/issues{/number}","pulls_url":"https://api.github.com/repos/bill-chadwick/ol3/pulls{/number}","milestones_url":"https://api.github.com/repos/bill-chadwick/ol3/milestones{/number}","notifications_url":"https://api.github.com/repos/bill-chadwick/ol3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bill-chadwick/ol3/labels{/name}","releases_url":"https://api.github.com/repos/bill-chadwick/ol3/releases{/id}","created_at":"2015-03-06T16:41:14Z","updated_at":"2015-03-24T22:26:49Z","pushed_at":"2015-10-25T07:26:22Z","git_url":"git://github.com/bill-chadwick/ol3.git","ssh_url":"git@github.com:bill-chadwick/ol3.git","clone_url":"https://github.com/bill-chadwick/ol3.git","svn_url":"https://github.com/bill-chadwick/ol3","homepage":"http://openlayers.org","size":42856,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openlayers:master","ref":"master","sha":"b27acb8d5e63a0363026d5e58c37ae38ba9a3192","user":{"login":"openlayers","id":240579,"avatar_url":"https://avatars.githubusercontent.com/u/240579?v=3","gravatar_id":"","url":"https://api.github.com/users/openlayers","html_url":"https://github.com/openlayers","followers_url":"https://api.github.com/users/openlayers/followers","following_url":"https://api.github.com/users/openlayers/following{/other_user}","gists_url":"https://api.github.com/users/openlayers/gists{/gist_id}","starred_url":"https://api.github.com/users/openlayers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openlayers/subscriptions","organizations_url":"https://api.github.com/users/openlayers/orgs","repos_url":"https://api.github.com/users/openlayers/repos","events_url":"https://api.github.com/users/openlayers/events{/privacy}","received_events_url":"https://api.github.com/users/openlayers/received_events","type":"Organization","site_admin":false},"repo":{"id":4723248,"name":"ol3","full_name":"openlayers/ol3","owner":{"login":"openlayers","id":240579,"avatar_url":"https://avatars.githubusercontent.com/u/240579?v=3","gravatar_id":"","url":"https://api.github.com/users/openlayers","html_url":"https://github.com/openlayers","followers_url":"https://api.github.com/users/openlayers/followers","following_url":"https://api.github.com/users/openlayers/following{/other_user}","gists_url":"https://api.github.com/users/openlayers/gists{/gist_id}","starred_url":"https://api.github.com/users/openlayers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openlayers/subscriptions","organizations_url":"https://api.github.com/users/openlayers/orgs","repos_url":"https://api.github.com/users/openlayers/repos","events_url":"https://api.github.com/users/openlayers/events{/privacy}","received_events_url":"https://api.github.com/users/openlayers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openlayers/ol3","description":"OpenLayers 3","fork":false,"url":"https://api.github.com/repos/openlayers/ol3","forks_url":"https://api.github.com/repos/openlayers/ol3/forks","keys_url":"https://api.github.com/repos/openlayers/ol3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openlayers/ol3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openlayers/ol3/teams","hooks_url":"https://api.github.com/repos/openlayers/ol3/hooks","issue_events_url":"https://api.github.com/repos/openlayers/ol3/issues/events{/number}","events_url":"https://api.github.com/repos/openlayers/ol3/events","assignees_url":"https://api.github.com/repos/openlayers/ol3/assignees{/user}","branches_url":"https://api.github.com/repos/openlayers/ol3/branches{/branch}","tags_url":"https://api.github.com/repos/openlayers/ol3/tags","blobs_url":"https://api.github.com/repos/openlayers/ol3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openlayers/ol3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openlayers/ol3/git/refs{/sha}","trees_url":"https://api.github.com/repos/openlayers/ol3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openlayers/ol3/statuses/{sha}","languages_url":"https://api.github.com/repos/openlayers/ol3/languages","stargazers_url":"https://api.github.com/repos/openlayers/ol3/stargazers","contributors_url":"https://api.github.com/repos/openlayers/ol3/contributors","subscribers_url":"https://api.github.com/repos/openlayers/ol3/subscribers","subscription_url":"https://api.github.com/repos/openlayers/ol3/subscription","commits_url":"https://api.github.com/repos/openlayers/ol3/commits{/sha}","git_commits_url":"https://api.github.com/repos/openlayers/ol3/git/commits{/sha}","comments_url":"https://api.github.com/repos/openlayers/ol3/comments{/number}","issue_comment_url":"https://api.github.com/repos/openlayers/ol3/issues/comments{/number}","contents_url":"https://api.github.com/repos/openlayers/ol3/contents/{+path}","compare_url":"https://api.github.com/repos/openlayers/ol3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openlayers/ol3/merges","archive_url":"https://api.github.com/repos/openlayers/ol3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openlayers/ol3/downloads","issues_url":"https://api.github.com/repos/openlayers/ol3/issues{/number}","pulls_url":"https://api.github.com/repos/openlayers/ol3/pulls{/number}","milestones_url":"https://api.github.com/repos/openlayers/ol3/milestones{/number}","notifications_url":"https://api.github.com/repos/openlayers/ol3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openlayers/ol3/labels{/name}","releases_url":"https://api.github.com/repos/openlayers/ol3/releases{/id}","created_at":"2012-06-20T06:53:59Z","updated_at":"2015-10-26T13:54:32Z","pushed_at":"2015-10-26T13:05:54Z","git_url":"git://github.com/openlayers/ol3.git","ssh_url":"git@github.com:openlayers/ol3.git","clone_url":"https://github.com/openlayers/ol3.git","svn_url":"https://github.com/openlayers/ol3","homepage":"http://openlayers.org","size":102831,"stargazers_count":1445,"watchers_count":1445,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":823,"mirror_url":null,"open_issues_count":375,"forks":823,"open_issues":375,"watchers":1445,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openlayers/ol3/pulls/4311"},"html":{"href":"https://github.com/openlayers/ol3/pull/4311"},"issue":{"href":"https://api.github.com/repos/openlayers/ol3/issues/4311"},"comments":{"href":"https://api.github.com/repos/openlayers/ol3/issues/4311/comments"},"review_comments":{"href":"https://api.github.com/repos/openlayers/ol3/pulls/4311/comments"},"review_comment":{"href":"https://api.github.com/repos/openlayers/ol3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openlayers/ol3/pulls/4311/commits"},"statuses":{"href":"https://api.github.com/repos/openlayers/ol3/statuses/de567fdaebd815413325ce9725d94ef4164d0790"}}}}