{"action":"opened","number":146,"pull_request":{"url":"https://api.github.com/repos/oskariorg/oskari-frontend/pulls/146","id":146768222,"html_url":"https://github.com/oskariorg/oskari-frontend/pull/146","diff_url":"https://github.com/oskariorg/oskari-frontend/pull/146.diff","patch_url":"https://github.com/oskariorg/oskari-frontend/pull/146.patch","issue_url":"https://api.github.com/repos/oskariorg/oskari-frontend/issues/146","number":146,"state":"open","locked":false,"title":"Drawtools fix","user":{"login":"ZakarFin","id":2210335,"avatar_url":"https://avatars3.githubusercontent.com/u/2210335?v=4","gravatar_id":"","url":"https://api.github.com/users/ZakarFin","html_url":"https://github.com/ZakarFin","followers_url":"https://api.github.com/users/ZakarFin/followers","following_url":"https://api.github.com/users/ZakarFin/following{/other_user}","gists_url":"https://api.github.com/users/ZakarFin/gists{/gist_id}","starred_url":"https://api.github.com/users/ZakarFin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZakarFin/subscriptions","organizations_url":"https://api.github.com/users/ZakarFin/orgs","repos_url":"https://api.github.com/users/ZakarFin/repos","events_url":"https://api.github.com/users/ZakarFin/events{/privacy}","received_events_url":"https://api.github.com/users/ZakarFin/received_events","type":"User","site_admin":false},"body":"This PR does too much as there's a lot of code moved around, changed variable references to more meaningful names and method calls. Some of the weird variables are commented with TODOs.  Also solves these actual problems:\r\n\r\n# Empty features after drawing\r\n\r\nFixed an issue where: \r\n\r\n1) Draw a shape (like Polygon) with functionality id 1\r\n2) Draw another type of shape (like LineString) with functionality id 2\r\n3) Draw the same shape as in step 1 with functionality id 3\r\n\r\nResulted in DrawingEvents on step 3 to have an empty features array. Features the user draws are now sent correctly.\r\n\r\n# Measures for features\r\n\r\nLength and area information in the event are now the sum for all the LineStrings (for length) and (non-intersecting) Polygons instead of the last drawn shape. To get the same information as before you can do `event.geojson.features[event.geojson.features.length - 1].properties.area`, but it makes more sense to have the sum on the data block instead of measures for the latest feature in a collection of features.\r\n\r\nNotes:\r\n\r\n- If you have just one feature ever this works like before.\r\n- Only lines and polygons are counted for the area/length (circles/points with buffers are not).\r\n- The measurements are for non-buffered features.","created_at":"2017-10-16T12:12:13Z","updated_at":"2017-10-16T12:12:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/oskariorg/oskari-frontend/pulls/146/commits","review_comments_url":"https://api.github.com/repos/oskariorg/oskari-frontend/pulls/146/comments","review_comment_url":"https://api.github.com/repos/oskariorg/oskari-frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oskariorg/oskari-frontend/issues/146/comments","statuses_url":"https://api.github.com/repos/oskariorg/oskari-frontend/statuses/92b10b46ea7d028de27e243fca9968a512eedcda","head":{"label":"ZakarFin:drawtools-fix","ref":"drawtools-fix","sha":"92b10b46ea7d028de27e243fca9968a512eedcda","user":{"login":"ZakarFin","id":2210335,"avatar_url":"https://avatars3.githubusercontent.com/u/2210335?v=4","gravatar_id":"","url":"https://api.github.com/users/ZakarFin","html_url":"https://github.com/ZakarFin","followers_url":"https://api.github.com/users/ZakarFin/followers","following_url":"https://api.github.com/users/ZakarFin/following{/other_user}","gists_url":"https://api.github.com/users/ZakarFin/gists{/gist_id}","starred_url":"https://api.github.com/users/ZakarFin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZakarFin/subscriptions","organizations_url":"https://api.github.com/users/ZakarFin/orgs","repos_url":"https://api.github.com/users/ZakarFin/repos","events_url":"https://api.github.com/users/ZakarFin/events{/privacy}","received_events_url":"https://api.github.com/users/ZakarFin/received_events","type":"User","site_admin":false},"repo":{"id":84537760,"name":"oskari-frontend","full_name":"ZakarFin/oskari-frontend","owner":{"login":"ZakarFin","id":2210335,"avatar_url":"https://avatars3.githubusercontent.com/u/2210335?v=4","gravatar_id":"","url":"https://api.github.com/users/ZakarFin","html_url":"https://github.com/ZakarFin","followers_url":"https://api.github.com/users/ZakarFin/followers","following_url":"https://api.github.com/users/ZakarFin/following{/other_user}","gists_url":"https://api.github.com/users/ZakarFin/gists{/gist_id}","starred_url":"https://api.github.com/users/ZakarFin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZakarFin/subscriptions","organizations_url":"https://api.github.com/users/ZakarFin/orgs","repos_url":"https://api.github.com/users/ZakarFin/repos","events_url":"https://api.github.com/users/ZakarFin/events{/privacy}","received_events_url":"https://api.github.com/users/ZakarFin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ZakarFin/oskari-frontend","description":"Frontend implementation for Oskari Map Application Framework","fork":true,"url":"https://api.github.com/repos/ZakarFin/oskari-frontend","forks_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/forks","keys_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/teams","hooks_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/hooks","issue_events_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/events","assignees_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/tags","blobs_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/languages","stargazers_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/stargazers","contributors_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/contributors","subscribers_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/subscribers","subscription_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/subscription","commits_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/merges","archive_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/downloads","issues_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/labels{/name}","releases_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/ZakarFin/oskari-frontend/deployments","created_at":"2017-03-10T08:32:30Z","updated_at":"2017-03-10T08:32:53Z","pushed_at":"2017-10-16T11:59:59Z","git_url":"git://github.com/ZakarFin/oskari-frontend.git","ssh_url":"git@github.com:ZakarFin/oskari-frontend.git","clone_url":"https://github.com/ZakarFin/oskari-frontend.git","svn_url":"https://github.com/ZakarFin/oskari-frontend","homepage":"http://www.oskari.org","size":112023,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"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":"oskariorg:hotfix/1.44.1","ref":"hotfix/1.44.1","sha":"702582e9ea5081ec078ae352630481cc845a7be3","user":{"login":"oskariorg","id":25427941,"avatar_url":"https://avatars1.githubusercontent.com/u/25427941?v=4","gravatar_id":"","url":"https://api.github.com/users/oskariorg","html_url":"https://github.com/oskariorg","followers_url":"https://api.github.com/users/oskariorg/followers","following_url":"https://api.github.com/users/oskariorg/following{/other_user}","gists_url":"https://api.github.com/users/oskariorg/gists{/gist_id}","starred_url":"https://api.github.com/users/oskariorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oskariorg/subscriptions","organizations_url":"https://api.github.com/users/oskariorg/orgs","repos_url":"https://api.github.com/users/oskariorg/repos","events_url":"https://api.github.com/users/oskariorg/events{/privacy}","received_events_url":"https://api.github.com/users/oskariorg/received_events","type":"Organization","site_admin":false},"repo":{"id":5537779,"name":"oskari-frontend","full_name":"oskariorg/oskari-frontend","owner":{"login":"oskariorg","id":25427941,"avatar_url":"https://avatars1.githubusercontent.com/u/25427941?v=4","gravatar_id":"","url":"https://api.github.com/users/oskariorg","html_url":"https://github.com/oskariorg","followers_url":"https://api.github.com/users/oskariorg/followers","following_url":"https://api.github.com/users/oskariorg/following{/other_user}","gists_url":"https://api.github.com/users/oskariorg/gists{/gist_id}","starred_url":"https://api.github.com/users/oskariorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oskariorg/subscriptions","organizations_url":"https://api.github.com/users/oskariorg/orgs","repos_url":"https://api.github.com/users/oskariorg/repos","events_url":"https://api.github.com/users/oskariorg/events{/privacy}","received_events_url":"https://api.github.com/users/oskariorg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oskariorg/oskari-frontend","description":"Frontend implementation for Oskari Map Application Framework","fork":false,"url":"https://api.github.com/repos/oskariorg/oskari-frontend","forks_url":"https://api.github.com/repos/oskariorg/oskari-frontend/forks","keys_url":"https://api.github.com/repos/oskariorg/oskari-frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oskariorg/oskari-frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oskariorg/oskari-frontend/teams","hooks_url":"https://api.github.com/repos/oskariorg/oskari-frontend/hooks","issue_events_url":"https://api.github.com/repos/oskariorg/oskari-frontend/issues/events{/number}","events_url":"https://api.github.com/repos/oskariorg/oskari-frontend/events","assignees_url":"https://api.github.com/repos/oskariorg/oskari-frontend/assignees{/user}","branches_url":"https://api.github.com/repos/oskariorg/oskari-frontend/branches{/branch}","tags_url":"https://api.github.com/repos/oskariorg/oskari-frontend/tags","blobs_url":"https://api.github.com/repos/oskariorg/oskari-frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oskariorg/oskari-frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oskariorg/oskari-frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/oskariorg/oskari-frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oskariorg/oskari-frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/oskariorg/oskari-frontend/languages","stargazers_url":"https://api.github.com/repos/oskariorg/oskari-frontend/stargazers","contributors_url":"https://api.github.com/repos/oskariorg/oskari-frontend/contributors","subscribers_url":"https://api.github.com/repos/oskariorg/oskari-frontend/subscribers","subscription_url":"https://api.github.com/repos/oskariorg/oskari-frontend/subscription","commits_url":"https://api.github.com/repos/oskariorg/oskari-frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/oskariorg/oskari-frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/oskariorg/oskari-frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/oskariorg/oskari-frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/oskariorg/oskari-frontend/contents/{+path}","compare_url":"https://api.github.com/repos/oskariorg/oskari-frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oskariorg/oskari-frontend/merges","archive_url":"https://api.github.com/repos/oskariorg/oskari-frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oskariorg/oskari-frontend/downloads","issues_url":"https://api.github.com/repos/oskariorg/oskari-frontend/issues{/number}","pulls_url":"https://api.github.com/repos/oskariorg/oskari-frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/oskariorg/oskari-frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/oskariorg/oskari-frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oskariorg/oskari-frontend/labels{/name}","releases_url":"https://api.github.com/repos/oskariorg/oskari-frontend/releases{/id}","deployments_url":"https://api.github.com/repos/oskariorg/oskari-frontend/deployments","created_at":"2012-08-24T08:44:24Z","updated_at":"2017-08-27T17:34:57Z","pushed_at":"2017-10-13T11:16:57Z","git_url":"git://github.com/oskariorg/oskari-frontend.git","ssh_url":"git@github.com:oskariorg/oskari-frontend.git","clone_url":"https://github.com/oskariorg/oskari-frontend.git","svn_url":"https://github.com/oskariorg/oskari-frontend","homepage":"http://www.oskari.org","size":112019,"stargazers_count":28,"watchers_count":28,"language":"JavaScript","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":44,"mirror_url":null,"open_issues_count":6,"forks":44,"open_issues":6,"watchers":28,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/oskariorg/oskari-frontend/pulls/146"},"html":{"href":"https://github.com/oskariorg/oskari-frontend/pull/146"},"issue":{"href":"https://api.github.com/repos/oskariorg/oskari-frontend/issues/146"},"comments":{"href":"https://api.github.com/repos/oskariorg/oskari-frontend/issues/146/comments"},"review_comments":{"href":"https://api.github.com/repos/oskariorg/oskari-frontend/pulls/146/comments"},"review_comment":{"href":"https://api.github.com/repos/oskariorg/oskari-frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oskariorg/oskari-frontend/pulls/146/commits"},"statuses":{"href":"https://api.github.com/repos/oskariorg/oskari-frontend/statuses/92b10b46ea7d028de27e243fca9968a512eedcda"}},"author_association":"OWNER","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":16,"additions":517,"deletions":343,"changed_files":4}}
{"actor":{"display_login":"ZakarFin"}}