{"action":"created","comment":{"url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/pulls/comments/171768524","pull_request_review_id":100680444,"id":171768524,"diff_hunk":"@@ -1,11 +1,35 @@\n-import React from 'react';\n-import PropTypes from 'prop-types';\n-import MapboxDraw from '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw';\n+import React from \"react\";\n+import PropTypes from \"prop-types\";\n+import MapboxDraw from \"@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw\";\n \n export default class DrawControl extends React.Component {\n   componentWillMount() {\n-    this.draw = new MapboxDraw(this.props);\n-    this.context.map.addControl(this.draw);\n+    //if custom modes, add to Mapbox draw modes\n+    const modes = MapboxDraw.modes;\n+    if (this.props.modes) {\n+      for (const mode in this.props.modes) {\n+        modes[mode] = this.props.modes[mode];\n+      }\n+    }\n+    const mapboxDrawProps = {\n+      ...this.props,\n+      modes: modes\n+    };\n+    this.draw = new MapboxDraw(mapboxDrawProps);\n+    this.context.map.addControl(this.draw, this.props.position);\n+    //hook draw events\n+    this.context.map.on(\"draw.create\", this.props.onDrawCreate);\n+    this.context.map.on(\"draw.delete\", this.props.onDrawDelete);\n+    this.context.map.on(\"draw.update\", this.props.onDrawUpdate);\n+    this.context.map.on(\"draw.combine\", this.props.onDrawCombine);\n+    this.context.map.on(\"draw.uncombine\", this.props.onDrawUncombine);","path":"src/index.js","position":null,"original_position":30,"commit_id":"325d4823d36bf2976db0f0ddf92613c57a59b70a","original_commit_id":"5944670b9e1b3c2daa783b09d0f88994e33674b2","user":{"login":"erick-otenyo","id":20169543,"avatar_url":"https://avatars1.githubusercontent.com/u/20169543?v=4","gravatar_id":"","url":"https://api.github.com/users/erick-otenyo","html_url":"https://github.com/erick-otenyo","followers_url":"https://api.github.com/users/erick-otenyo/followers","following_url":"https://api.github.com/users/erick-otenyo/following{/other_user}","gists_url":"https://api.github.com/users/erick-otenyo/gists{/gist_id}","starred_url":"https://api.github.com/users/erick-otenyo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erick-otenyo/subscriptions","organizations_url":"https://api.github.com/users/erick-otenyo/orgs","repos_url":"https://api.github.com/users/erick-otenyo/repos","events_url":"https://api.github.com/users/erick-otenyo/events{/privacy}","received_events_url":"https://api.github.com/users/erick-otenyo/received_events","type":"User","site_admin":false},"body":"okay..done","created_at":"2018-03-02T05:44:19Z","updated_at":"2018-03-02T05:44:19Z","html_url":"https://github.com/amaurymartiny/react-mapbox-gl-draw/pull/5#discussion_r171768524","pull_request_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/pulls/5","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/pulls/comments/171768524"},"html":{"href":"https://github.com/amaurymartiny/react-mapbox-gl-draw/pull/5#discussion_r171768524"},"pull_request":{"href":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/pulls/5"}},"in_reply_to_id":171608101},"pull_request":{"url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/pulls/5","id":170954545,"html_url":"https://github.com/amaurymartiny/react-mapbox-gl-draw/pull/5","diff_url":"https://github.com/amaurymartiny/react-mapbox-gl-draw/pull/5.diff","patch_url":"https://github.com/amaurymartiny/react-mapbox-gl-draw/pull/5.patch","issue_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/issues/5","number":5,"state":"open","locked":false,"title":"Implement draw events as props","user":{"login":"erick-otenyo","id":20169543,"avatar_url":"https://avatars1.githubusercontent.com/u/20169543?v=4","gravatar_id":"","url":"https://api.github.com/users/erick-otenyo","html_url":"https://github.com/erick-otenyo","followers_url":"https://api.github.com/users/erick-otenyo/followers","following_url":"https://api.github.com/users/erick-otenyo/following{/other_user}","gists_url":"https://api.github.com/users/erick-otenyo/gists{/gist_id}","starred_url":"https://api.github.com/users/erick-otenyo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erick-otenyo/subscriptions","organizations_url":"https://api.github.com/users/erick-otenyo/orgs","repos_url":"https://api.github.com/users/erick-otenyo/repos","events_url":"https://api.github.com/users/erick-otenyo/events{/privacy}","received_events_url":"https://api.github.com/users/erick-otenyo/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-23T08:09:35Z","updated_at":"2018-03-02T05:44:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0ff5396cd572c24495e25e335956ce6aff33c854","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/pulls/5/commits","review_comments_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/pulls/5/comments","review_comment_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/pulls/comments{/number}","comments_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/issues/5/comments","statuses_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/statuses/325d4823d36bf2976db0f0ddf92613c57a59b70a","head":{"label":"edgespatial:master","ref":"master","sha":"325d4823d36bf2976db0f0ddf92613c57a59b70a","user":{"login":"edgespatial","id":25146281,"avatar_url":"https://avatars0.githubusercontent.com/u/25146281?v=4","gravatar_id":"","url":"https://api.github.com/users/edgespatial","html_url":"https://github.com/edgespatial","followers_url":"https://api.github.com/users/edgespatial/followers","following_url":"https://api.github.com/users/edgespatial/following{/other_user}","gists_url":"https://api.github.com/users/edgespatial/gists{/gist_id}","starred_url":"https://api.github.com/users/edgespatial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edgespatial/subscriptions","organizations_url":"https://api.github.com/users/edgespatial/orgs","repos_url":"https://api.github.com/users/edgespatial/repos","events_url":"https://api.github.com/users/edgespatial/events{/privacy}","received_events_url":"https://api.github.com/users/edgespatial/received_events","type":"Organization","site_admin":false},"repo":{"id":122310474,"name":"react-mapbox-gl-draw","full_name":"edgespatial/react-mapbox-gl-draw","owner":{"login":"edgespatial","id":25146281,"avatar_url":"https://avatars0.githubusercontent.com/u/25146281?v=4","gravatar_id":"","url":"https://api.github.com/users/edgespatial","html_url":"https://github.com/edgespatial","followers_url":"https://api.github.com/users/edgespatial/followers","following_url":"https://api.github.com/users/edgespatial/following{/other_user}","gists_url":"https://api.github.com/users/edgespatial/gists{/gist_id}","starred_url":"https://api.github.com/users/edgespatial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edgespatial/subscriptions","organizations_url":"https://api.github.com/users/edgespatial/orgs","repos_url":"https://api.github.com/users/edgespatial/repos","events_url":"https://api.github.com/users/edgespatial/events{/privacy}","received_events_url":"https://api.github.com/users/edgespatial/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edgespatial/react-mapbox-gl-draw","description":"Draw tools for Mapbox with React: react-mapbox-gl + mapbox-gl-draw - With draw events","fork":true,"url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw","forks_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/forks","keys_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/teams","hooks_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/hooks","issue_events_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/issues/events{/number}","events_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/events","assignees_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/assignees{/user}","branches_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/branches{/branch}","tags_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/tags","blobs_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/git/refs{/sha}","trees_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/statuses/{sha}","languages_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/languages","stargazers_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/stargazers","contributors_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/contributors","subscribers_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/subscribers","subscription_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/subscription","commits_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/commits{/sha}","git_commits_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/git/commits{/sha}","comments_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/comments{/number}","issue_comment_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/issues/comments{/number}","contents_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/contents/{+path}","compare_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/merges","archive_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/downloads","issues_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/issues{/number}","pulls_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/pulls{/number}","milestones_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/milestones{/number}","notifications_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/labels{/name}","releases_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/releases{/id}","deployments_url":"https://api.github.com/repos/edgespatial/react-mapbox-gl-draw/deployments","created_at":"2018-02-21T08:33:05Z","updated_at":"2018-02-24T08:21:23Z","pushed_at":"2018-03-02T05:43:42Z","git_url":"git://github.com/edgespatial/react-mapbox-gl-draw.git","ssh_url":"git@github.com:edgespatial/react-mapbox-gl-draw.git","clone_url":"https://github.com/edgespatial/react-mapbox-gl-draw.git","svn_url":"https://github.com/edgespatial/react-mapbox-gl-draw","homepage":"","size":167,"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,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"amaurymartiny:master","ref":"master","sha":"759cf8e18b94446bcc6be49147c9e8ad068d11de","user":{"login":"amaurymartiny","id":1293565,"avatar_url":"https://avatars0.githubusercontent.com/u/1293565?v=4","gravatar_id":"","url":"https://api.github.com/users/amaurymartiny","html_url":"https://github.com/amaurymartiny","followers_url":"https://api.github.com/users/amaurymartiny/followers","following_url":"https://api.github.com/users/amaurymartiny/following{/other_user}","gists_url":"https://api.github.com/users/amaurymartiny/gists{/gist_id}","starred_url":"https://api.github.com/users/amaurymartiny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaurymartiny/subscriptions","organizations_url":"https://api.github.com/users/amaurymartiny/orgs","repos_url":"https://api.github.com/users/amaurymartiny/repos","events_url":"https://api.github.com/users/amaurymartiny/events{/privacy}","received_events_url":"https://api.github.com/users/amaurymartiny/received_events","type":"User","site_admin":false},"repo":{"id":100995138,"name":"react-mapbox-gl-draw","full_name":"amaurymartiny/react-mapbox-gl-draw","owner":{"login":"amaurymartiny","id":1293565,"avatar_url":"https://avatars0.githubusercontent.com/u/1293565?v=4","gravatar_id":"","url":"https://api.github.com/users/amaurymartiny","html_url":"https://github.com/amaurymartiny","followers_url":"https://api.github.com/users/amaurymartiny/followers","following_url":"https://api.github.com/users/amaurymartiny/following{/other_user}","gists_url":"https://api.github.com/users/amaurymartiny/gists{/gist_id}","starred_url":"https://api.github.com/users/amaurymartiny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaurymartiny/subscriptions","organizations_url":"https://api.github.com/users/amaurymartiny/orgs","repos_url":"https://api.github.com/users/amaurymartiny/repos","events_url":"https://api.github.com/users/amaurymartiny/events{/privacy}","received_events_url":"https://api.github.com/users/amaurymartiny/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/amaurymartiny/react-mapbox-gl-draw","description":"Draw tools for Mapbox with React: react-mapbox-gl + mapbox-gl-draw","fork":false,"url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw","forks_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/forks","keys_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/teams","hooks_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/hooks","issue_events_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/issues/events{/number}","events_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/events","assignees_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/assignees{/user}","branches_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/branches{/branch}","tags_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/tags","blobs_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/git/refs{/sha}","trees_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/statuses/{sha}","languages_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/languages","stargazers_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/stargazers","contributors_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/contributors","subscribers_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/subscribers","subscription_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/subscription","commits_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/commits{/sha}","git_commits_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/git/commits{/sha}","comments_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/comments{/number}","issue_comment_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/issues/comments{/number}","contents_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/contents/{+path}","compare_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/merges","archive_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/downloads","issues_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/issues{/number}","pulls_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/pulls{/number}","milestones_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/milestones{/number}","notifications_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/labels{/name}","releases_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/releases{/id}","deployments_url":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/deployments","created_at":"2017-08-21T21:45:50Z","updated_at":"2018-02-01T17:16:31Z","pushed_at":"2018-03-02T05:43:44Z","git_url":"git://github.com/amaurymartiny/react-mapbox-gl-draw.git","ssh_url":"git@github.com:amaurymartiny/react-mapbox-gl-draw.git","clone_url":"https://github.com/amaurymartiny/react-mapbox-gl-draw.git","svn_url":"https://github.com/amaurymartiny/react-mapbox-gl-draw","homepage":null,"size":145,"stargazers_count":19,"watchers_count":19,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":5,"open_issues":2,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/pulls/5"},"html":{"href":"https://github.com/amaurymartiny/react-mapbox-gl-draw/pull/5"},"issue":{"href":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/issues/5"},"comments":{"href":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/amaurymartiny/react-mapbox-gl-draw/statuses/325d4823d36bf2976db0f0ddf92613c57a59b70a"}},"author_association":"NONE"}}
{"actor":{"display_login":"erick-otenyo"}}