{"action":"created","comment":{"url":"https://api.github.com/repos/boundlessgeo/sdk/pulls/comments/130126637","pull_request_review_id":52972122,"id":130126637,"diff_hunk":"@@ -676,6 +715,65 @@ export class Map extends React.Component {\n     });\n   }\n \n+  updateInteraction(drawingProps) {\n+    // this assumes the interaction is different,\n+    //  so the first thing to do is clear out the old interaction\n+    if (this.activeInteractions !== null) {\n+      for (let i = 0, ii = this.activeInteractions.length; i < ii; i++) {\n+        this.map.removeInteraction(this.activeInteractions[i]);\n+      }\n+      this.activeInteractions = null;\n+    }\n+\n+    if (drawingProps.interaction === INTERACTIONS.modify) {\n+      const select = new SelectInteraction({\n+        wrapX: false,\n+      });\n+\n+      const modify = new ModifyInteraction({\n+        features: select.getFeatures(),\n+      });\n+\n+      modify.on('modifyend', (evt) => {\n+        this.onFeatureEvent('modified', drawingProps.sourceName, evt.features.item(0));\n+      });\n+\n+      this.activeInteractions = [select, modify];\n+    } else if (drawingProps.interaction === INTERACTIONS.select) {\n+      // TODO: Select is typically a single-feature affair but there\n+      //       should be support for multiple feature selections in the future.\n+      const select = new SelectInteraction({","path":"src/components/map.jsx","position":99,"original_position":99,"commit_id":"a18fb8890dd209b97c8f11ea98071e4da037f87c","original_commit_id":"a18fb8890dd209b97c8f11ea98071e4da037f87c","user":{"login":"theduckylittle","id":1282291,"avatar_url":"https://avatars2.githubusercontent.com/u/1282291?v=4","gravatar_id":"","url":"https://api.github.com/users/theduckylittle","html_url":"https://github.com/theduckylittle","followers_url":"https://api.github.com/users/theduckylittle/followers","following_url":"https://api.github.com/users/theduckylittle/following{/other_user}","gists_url":"https://api.github.com/users/theduckylittle/gists{/gist_id}","starred_url":"https://api.github.com/users/theduckylittle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theduckylittle/subscriptions","organizations_url":"https://api.github.com/users/theduckylittle/orgs","repos_url":"https://api.github.com/users/theduckylittle/repos","events_url":"https://api.github.com/users/theduckylittle/events{/privacy}","received_events_url":"https://api.github.com/users/theduckylittle/received_events","type":"User","site_admin":false},"body":"No because select is defined in two different code blocks and as a \"const\", const/let keep their scope local to whichever block they are defined within.","created_at":"2017-07-28T16:04:21Z","updated_at":"2017-07-28T16:04:21Z","html_url":"https://github.com/boundlessgeo/sdk/pull/575#discussion_r130126637","pull_request_url":"https://api.github.com/repos/boundlessgeo/sdk/pulls/575","_links":{"self":{"href":"https://api.github.com/repos/boundlessgeo/sdk/pulls/comments/130126637"},"html":{"href":"https://github.com/boundlessgeo/sdk/pull/575#discussion_r130126637"},"pull_request":{"href":"https://api.github.com/repos/boundlessgeo/sdk/pulls/575"}}},"pull_request":{"url":"https://api.github.com/repos/boundlessgeo/sdk/pulls/575","id":132606852,"html_url":"https://github.com/boundlessgeo/sdk/pull/575","diff_url":"https://github.com/boundlessgeo/sdk/pull/575.diff","patch_url":"https://github.com/boundlessgeo/sdk/pull/575.patch","issue_url":"https://api.github.com/repos/boundlessgeo/sdk/issues/575","number":575,"state":"open","locked":false,"title":"Features can now be drawn on the map!","user":{"login":"theduckylittle","id":1282291,"avatar_url":"https://avatars2.githubusercontent.com/u/1282291?v=4","gravatar_id":"","url":"https://api.github.com/users/theduckylittle","html_url":"https://github.com/theduckylittle","followers_url":"https://api.github.com/users/theduckylittle/followers","following_url":"https://api.github.com/users/theduckylittle/following{/other_user}","gists_url":"https://api.github.com/users/theduckylittle/gists{/gist_id}","starred_url":"https://api.github.com/users/theduckylittle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theduckylittle/subscriptions","organizations_url":"https://api.github.com/users/theduckylittle/orgs","repos_url":"https://api.github.com/users/theduckylittle/repos","events_url":"https://api.github.com/users/theduckylittle/events{/privacy}","received_events_url":"https://api.github.com/users/theduckylittle/received_events","type":"User","site_admin":false},"body":"1. Added a special reducer/action set in order to handle\r\n   the drawing functions (as they are not covered by mapbox gl styles).\r\n2. Modified the map component to use drawing.interaction and drawing.sourceName\r\n   props for identifying when a feature is being drawn and on to what.\r\n3. Created an example app with a working demo that includes onFeatureDrawn\r\n   which is the call back provided upon a features drawing completion.\r\n4. Needed to add the canvas module to the dev dependencies.\r\n   By default jsdom/enzyme/jest does not emulate the canvas, they\r\n   depend on the canvas package. This may not be practical to install\r\n   for all dev environments (looking at you, Windows) and may need to\r\n   be shifted to a peerDependency.\r\n5. The map has withRef: true in order to support introspection.\r\n\r\nRefs: SDK-500, SDK-535","created_at":"2017-07-26T20:29:58Z","updated_at":"2017-07-28T16:04:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a340dc71a46ed2f8202d126f2b36438ad1da048c","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/boundlessgeo/sdk/pulls/575/commits","review_comments_url":"https://api.github.com/repos/boundlessgeo/sdk/pulls/575/comments","review_comment_url":"https://api.github.com/repos/boundlessgeo/sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/boundlessgeo/sdk/issues/575/comments","statuses_url":"https://api.github.com/repos/boundlessgeo/sdk/statuses/a18fb8890dd209b97c8f11ea98071e4da037f87c","head":{"label":"theduckylittle:feature/drawing","ref":"feature/drawing","sha":"a18fb8890dd209b97c8f11ea98071e4da037f87c","user":{"login":"theduckylittle","id":1282291,"avatar_url":"https://avatars2.githubusercontent.com/u/1282291?v=4","gravatar_id":"","url":"https://api.github.com/users/theduckylittle","html_url":"https://github.com/theduckylittle","followers_url":"https://api.github.com/users/theduckylittle/followers","following_url":"https://api.github.com/users/theduckylittle/following{/other_user}","gists_url":"https://api.github.com/users/theduckylittle/gists{/gist_id}","starred_url":"https://api.github.com/users/theduckylittle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theduckylittle/subscriptions","organizations_url":"https://api.github.com/users/theduckylittle/orgs","repos_url":"https://api.github.com/users/theduckylittle/repos","events_url":"https://api.github.com/users/theduckylittle/events{/privacy}","received_events_url":"https://api.github.com/users/theduckylittle/received_events","type":"User","site_admin":false},"repo":{"id":86463069,"name":"sdk","full_name":"theduckylittle/sdk","owner":{"login":"theduckylittle","id":1282291,"avatar_url":"https://avatars2.githubusercontent.com/u/1282291?v=4","gravatar_id":"","url":"https://api.github.com/users/theduckylittle","html_url":"https://github.com/theduckylittle","followers_url":"https://api.github.com/users/theduckylittle/followers","following_url":"https://api.github.com/users/theduckylittle/following{/other_user}","gists_url":"https://api.github.com/users/theduckylittle/gists{/gist_id}","starred_url":"https://api.github.com/users/theduckylittle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theduckylittle/subscriptions","organizations_url":"https://api.github.com/users/theduckylittle/orgs","repos_url":"https://api.github.com/users/theduckylittle/repos","events_url":"https://api.github.com/users/theduckylittle/events{/privacy}","received_events_url":"https://api.github.com/users/theduckylittle/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/theduckylittle/sdk","description":"New javascript SDK based on React and Flux","fork":true,"url":"https://api.github.com/repos/theduckylittle/sdk","forks_url":"https://api.github.com/repos/theduckylittle/sdk/forks","keys_url":"https://api.github.com/repos/theduckylittle/sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theduckylittle/sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theduckylittle/sdk/teams","hooks_url":"https://api.github.com/repos/theduckylittle/sdk/hooks","issue_events_url":"https://api.github.com/repos/theduckylittle/sdk/issues/events{/number}","events_url":"https://api.github.com/repos/theduckylittle/sdk/events","assignees_url":"https://api.github.com/repos/theduckylittle/sdk/assignees{/user}","branches_url":"https://api.github.com/repos/theduckylittle/sdk/branches{/branch}","tags_url":"https://api.github.com/repos/theduckylittle/sdk/tags","blobs_url":"https://api.github.com/repos/theduckylittle/sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theduckylittle/sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theduckylittle/sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/theduckylittle/sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theduckylittle/sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/theduckylittle/sdk/languages","stargazers_url":"https://api.github.com/repos/theduckylittle/sdk/stargazers","contributors_url":"https://api.github.com/repos/theduckylittle/sdk/contributors","subscribers_url":"https://api.github.com/repos/theduckylittle/sdk/subscribers","subscription_url":"https://api.github.com/repos/theduckylittle/sdk/subscription","commits_url":"https://api.github.com/repos/theduckylittle/sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/theduckylittle/sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/theduckylittle/sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/theduckylittle/sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/theduckylittle/sdk/contents/{+path}","compare_url":"https://api.github.com/repos/theduckylittle/sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theduckylittle/sdk/merges","archive_url":"https://api.github.com/repos/theduckylittle/sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theduckylittle/sdk/downloads","issues_url":"https://api.github.com/repos/theduckylittle/sdk/issues{/number}","pulls_url":"https://api.github.com/repos/theduckylittle/sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/theduckylittle/sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/theduckylittle/sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theduckylittle/sdk/labels{/name}","releases_url":"https://api.github.com/repos/theduckylittle/sdk/releases{/id}","deployments_url":"https://api.github.com/repos/theduckylittle/sdk/deployments","created_at":"2017-03-28T13:25:10Z","updated_at":"2017-03-28T13:25:12Z","pushed_at":"2017-07-27T16:00:40Z","git_url":"git://github.com/theduckylittle/sdk.git","ssh_url":"git@github.com:theduckylittle/sdk.git","clone_url":"https://github.com/theduckylittle/sdk.git","svn_url":"https://github.com/theduckylittle/sdk","homepage":"","size":62170,"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":"boundlessgeo:ultimateredux","ref":"ultimateredux","sha":"2ae112d3af266def187ad995c1a684fe80b00132","user":{"login":"boundlessgeo","id":306022,"avatar_url":"https://avatars0.githubusercontent.com/u/306022?v=4","gravatar_id":"","url":"https://api.github.com/users/boundlessgeo","html_url":"https://github.com/boundlessgeo","followers_url":"https://api.github.com/users/boundlessgeo/followers","following_url":"https://api.github.com/users/boundlessgeo/following{/other_user}","gists_url":"https://api.github.com/users/boundlessgeo/gists{/gist_id}","starred_url":"https://api.github.com/users/boundlessgeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boundlessgeo/subscriptions","organizations_url":"https://api.github.com/users/boundlessgeo/orgs","repos_url":"https://api.github.com/users/boundlessgeo/repos","events_url":"https://api.github.com/users/boundlessgeo/events{/privacy}","received_events_url":"https://api.github.com/users/boundlessgeo/received_events","type":"Organization","site_admin":false},"repo":{"id":36792837,"name":"sdk","full_name":"boundlessgeo/sdk","owner":{"login":"boundlessgeo","id":306022,"avatar_url":"https://avatars0.githubusercontent.com/u/306022?v=4","gravatar_id":"","url":"https://api.github.com/users/boundlessgeo","html_url":"https://github.com/boundlessgeo","followers_url":"https://api.github.com/users/boundlessgeo/followers","following_url":"https://api.github.com/users/boundlessgeo/following{/other_user}","gists_url":"https://api.github.com/users/boundlessgeo/gists{/gist_id}","starred_url":"https://api.github.com/users/boundlessgeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boundlessgeo/subscriptions","organizations_url":"https://api.github.com/users/boundlessgeo/orgs","repos_url":"https://api.github.com/users/boundlessgeo/repos","events_url":"https://api.github.com/users/boundlessgeo/events{/privacy}","received_events_url":"https://api.github.com/users/boundlessgeo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/boundlessgeo/sdk","description":"New javascript SDK based on React and Flux","fork":false,"url":"https://api.github.com/repos/boundlessgeo/sdk","forks_url":"https://api.github.com/repos/boundlessgeo/sdk/forks","keys_url":"https://api.github.com/repos/boundlessgeo/sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/boundlessgeo/sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/boundlessgeo/sdk/teams","hooks_url":"https://api.github.com/repos/boundlessgeo/sdk/hooks","issue_events_url":"https://api.github.com/repos/boundlessgeo/sdk/issues/events{/number}","events_url":"https://api.github.com/repos/boundlessgeo/sdk/events","assignees_url":"https://api.github.com/repos/boundlessgeo/sdk/assignees{/user}","branches_url":"https://api.github.com/repos/boundlessgeo/sdk/branches{/branch}","tags_url":"https://api.github.com/repos/boundlessgeo/sdk/tags","blobs_url":"https://api.github.com/repos/boundlessgeo/sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/boundlessgeo/sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/boundlessgeo/sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/boundlessgeo/sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/boundlessgeo/sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/boundlessgeo/sdk/languages","stargazers_url":"https://api.github.com/repos/boundlessgeo/sdk/stargazers","contributors_url":"https://api.github.com/repos/boundlessgeo/sdk/contributors","subscribers_url":"https://api.github.com/repos/boundlessgeo/sdk/subscribers","subscription_url":"https://api.github.com/repos/boundlessgeo/sdk/subscription","commits_url":"https://api.github.com/repos/boundlessgeo/sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/boundlessgeo/sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/boundlessgeo/sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/boundlessgeo/sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/boundlessgeo/sdk/contents/{+path}","compare_url":"https://api.github.com/repos/boundlessgeo/sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/boundlessgeo/sdk/merges","archive_url":"https://api.github.com/repos/boundlessgeo/sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/boundlessgeo/sdk/downloads","issues_url":"https://api.github.com/repos/boundlessgeo/sdk/issues{/number}","pulls_url":"https://api.github.com/repos/boundlessgeo/sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/boundlessgeo/sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/boundlessgeo/sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/boundlessgeo/sdk/labels{/name}","releases_url":"https://api.github.com/repos/boundlessgeo/sdk/releases{/id}","deployments_url":"https://api.github.com/repos/boundlessgeo/sdk/deployments","created_at":"2015-06-03T09:13:14Z","updated_at":"2017-07-25T04:13:06Z","pushed_at":"2017-07-27T16:00:41Z","git_url":"git://github.com/boundlessgeo/sdk.git","ssh_url":"git@github.com:boundlessgeo/sdk.git","clone_url":"https://github.com/boundlessgeo/sdk.git","svn_url":"https://github.com/boundlessgeo/sdk","homepage":"","size":69005,"stargazers_count":27,"watchers_count":27,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":16,"mirror_url":null,"open_issues_count":22,"forks":16,"open_issues":22,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/boundlessgeo/sdk/pulls/575"},"html":{"href":"https://github.com/boundlessgeo/sdk/pull/575"},"issue":{"href":"https://api.github.com/repos/boundlessgeo/sdk/issues/575"},"comments":{"href":"https://api.github.com/repos/boundlessgeo/sdk/issues/575/comments"},"review_comments":{"href":"https://api.github.com/repos/boundlessgeo/sdk/pulls/575/comments"},"review_comment":{"href":"https://api.github.com/repos/boundlessgeo/sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/boundlessgeo/sdk/pulls/575/commits"},"statuses":{"href":"https://api.github.com/repos/boundlessgeo/sdk/statuses/a18fb8890dd209b97c8f11ea98071e4da037f87c"}}}}
{"actor":{"display_login":"theduckylittle"}}