{"action":"created","comment":{"url":"https://api.github.com/repos/django/django/pulls/comments/33972430","id":33972430,"diff_hunk":"@@ -0,0 +1,220 @@\n+GeometryTypeControl = function(opt_options) {\n+    // Map control to switch type when geometry type is unknown\n+    var options = opt_options || {};\n+\n+    var element = document.createElement('div');\n+    element.className = 'switch-type type-' + options.type + ' ol-control ol-unselectable';\n+    if (options.active) element.className += \" type-active\";\n+\n+    var self = this;\n+    var switchType = function(e) {\n+        e.preventDefault();\n+        if (options.widget.currentGeometryType != self) {\n+            options.widget.map.removeInteraction(options.widget.interactions.draw);\n+            options.widget.interactions.draw = new ol.interaction.Draw({\n+                features: options.widget.featureOverlay.getFeatures(),\n+                type: options.type\n+            });\n+            options.widget.map.addInteraction(options.widget.interactions.draw);\n+            options.widget.currentGeometryType.element.className = options.widget.currentGeometryType.element.className.replace(/ type-active/g, '');","path":"django/contrib/gis/static/gis/js/OL3MapWidget.js","position":21,"original_position":19,"commit_id":"3da1d00a792e84ac9c0885355f820efe16769fae","original_commit_id":"1ead6fada5b6d4820441fadb08a56074991ccb27","user":{"login":"timgraham","id":411869,"avatar_url":"https://avatars.githubusercontent.com/u/411869?v=3","gravatar_id":"","url":"https://api.github.com/users/timgraham","html_url":"https://github.com/timgraham","followers_url":"https://api.github.com/users/timgraham/followers","following_url":"https://api.github.com/users/timgraham/following{/other_user}","gists_url":"https://api.github.com/users/timgraham/gists{/gist_id}","starred_url":"https://api.github.com/users/timgraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timgraham/subscriptions","organizations_url":"https://api.github.com/users/timgraham/orgs","repos_url":"https://api.github.com/users/timgraham/repos","events_url":"https://api.github.com/users/timgraham/events{/privacy}","received_events_url":"https://api.github.com/users/timgraham/received_events","type":"User","site_admin":false},"body":"```\r\nvar className = options.widget.currentGeometryType.element.className.replace(/ type-active/g, '');\r\noptions.widget.currentGeometryType.element.className = className;\r\n```","created_at":"2015-07-06T19:27:23Z","updated_at":"2015-07-06T19:27:23Z","html_url":"https://github.com/django/django/pull/4889#discussion_r33972430","pull_request_url":"https://api.github.com/repos/django/django/pulls/4889","_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/comments/33972430"},"html":{"href":"https://github.com/django/django/pull/4889#discussion_r33972430"},"pull_request":{"href":"https://api.github.com/repos/django/django/pulls/4889"}}},"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/4889","id":38085836,"html_url":"https://github.com/django/django/pull/4889","diff_url":"https://github.com/django/django/pull/4889.diff","patch_url":"https://github.com/django/django/pull/4889.patch","issue_url":"https://api.github.com/repos/django/django/issues/4889","number":4889,"state":"open","locked":false,"title":"Fixed #25004 -- Added an OpenLayers 3 map widget","user":{"login":"claudep","id":143192,"avatar_url":"https://avatars.githubusercontent.com/u/143192?v=3","gravatar_id":"","url":"https://api.github.com/users/claudep","html_url":"https://github.com/claudep","followers_url":"https://api.github.com/users/claudep/followers","following_url":"https://api.github.com/users/claudep/following{/other_user}","gists_url":"https://api.github.com/users/claudep/gists{/gist_id}","starred_url":"https://api.github.com/users/claudep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claudep/subscriptions","organizations_url":"https://api.github.com/users/claudep/orgs","repos_url":"https://api.github.com/users/claudep/repos","events_url":"https://api.github.com/users/claudep/events{/privacy}","received_events_url":"https://api.github.com/users/claudep/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-19T08:16:47Z","updated_at":"2015-07-06T19:27:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"900184111835205cc92d64b3b67c9584010751a4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/django/django/pulls/4889/commits","review_comments_url":"https://api.github.com/repos/django/django/pulls/4889/comments","review_comment_url":"https://api.github.com/repos/django/django/pulls/comments{/number}","comments_url":"https://api.github.com/repos/django/django/issues/4889/comments","statuses_url":"https://api.github.com/repos/django/django/statuses/3da1d00a792e84ac9c0885355f820efe16769fae","head":{"label":"claudep:25004","ref":"25004","sha":"3da1d00a792e84ac9c0885355f820efe16769fae","user":{"login":"claudep","id":143192,"avatar_url":"https://avatars.githubusercontent.com/u/143192?v=3","gravatar_id":"","url":"https://api.github.com/users/claudep","html_url":"https://github.com/claudep","followers_url":"https://api.github.com/users/claudep/followers","following_url":"https://api.github.com/users/claudep/following{/other_user}","gists_url":"https://api.github.com/users/claudep/gists{/gist_id}","starred_url":"https://api.github.com/users/claudep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claudep/subscriptions","organizations_url":"https://api.github.com/users/claudep/orgs","repos_url":"https://api.github.com/users/claudep/repos","events_url":"https://api.github.com/users/claudep/events{/privacy}","received_events_url":"https://api.github.com/users/claudep/received_events","type":"User","site_admin":false},"repo":{"id":4217165,"name":"django","full_name":"claudep/django","owner":{"login":"claudep","id":143192,"avatar_url":"https://avatars.githubusercontent.com/u/143192?v=3","gravatar_id":"","url":"https://api.github.com/users/claudep","html_url":"https://github.com/claudep","followers_url":"https://api.github.com/users/claudep/followers","following_url":"https://api.github.com/users/claudep/following{/other_user}","gists_url":"https://api.github.com/users/claudep/gists{/gist_id}","starred_url":"https://api.github.com/users/claudep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claudep/subscriptions","organizations_url":"https://api.github.com/users/claudep/orgs","repos_url":"https://api.github.com/users/claudep/repos","events_url":"https://api.github.com/users/claudep/events{/privacy}","received_events_url":"https://api.github.com/users/claudep/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/claudep/django","description":"The Web framework for perfectionists with deadlines. Now on GitHub.","fork":true,"url":"https://api.github.com/repos/claudep/django","forks_url":"https://api.github.com/repos/claudep/django/forks","keys_url":"https://api.github.com/repos/claudep/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/claudep/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/claudep/django/teams","hooks_url":"https://api.github.com/repos/claudep/django/hooks","issue_events_url":"https://api.github.com/repos/claudep/django/issues/events{/number}","events_url":"https://api.github.com/repos/claudep/django/events","assignees_url":"https://api.github.com/repos/claudep/django/assignees{/user}","branches_url":"https://api.github.com/repos/claudep/django/branches{/branch}","tags_url":"https://api.github.com/repos/claudep/django/tags","blobs_url":"https://api.github.com/repos/claudep/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/claudep/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/claudep/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/claudep/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/claudep/django/statuses/{sha}","languages_url":"https://api.github.com/repos/claudep/django/languages","stargazers_url":"https://api.github.com/repos/claudep/django/stargazers","contributors_url":"https://api.github.com/repos/claudep/django/contributors","subscribers_url":"https://api.github.com/repos/claudep/django/subscribers","subscription_url":"https://api.github.com/repos/claudep/django/subscription","commits_url":"https://api.github.com/repos/claudep/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/claudep/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/claudep/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/claudep/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/claudep/django/contents/{+path}","compare_url":"https://api.github.com/repos/claudep/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/claudep/django/merges","archive_url":"https://api.github.com/repos/claudep/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/claudep/django/downloads","issues_url":"https://api.github.com/repos/claudep/django/issues{/number}","pulls_url":"https://api.github.com/repos/claudep/django/pulls{/number}","milestones_url":"https://api.github.com/repos/claudep/django/milestones{/number}","notifications_url":"https://api.github.com/repos/claudep/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/claudep/django/labels{/name}","releases_url":"https://api.github.com/repos/claudep/django/releases{/id}","created_at":"2012-05-03T18:20:44Z","updated_at":"2015-04-24T14:29:13Z","pushed_at":"2015-07-01T14:32:53Z","git_url":"git://github.com/claudep/django.git","ssh_url":"git@github.com:claudep/django.git","clone_url":"https://github.com/claudep/django.git","svn_url":"https://github.com/claudep/django","homepage":"http://www.djangoproject.com/","size":114539,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"django:master","ref":"master","sha":"a50b66da30320887c23c73927f6b2ab41e0301bf","user":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"repo":{"id":4164482,"name":"django","full_name":"django/django","owner":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/django/django","description":"The Web framework for perfectionists with deadlines.","fork":false,"url":"https://api.github.com/repos/django/django","forks_url":"https://api.github.com/repos/django/django/forks","keys_url":"https://api.github.com/repos/django/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/django/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/django/django/teams","hooks_url":"https://api.github.com/repos/django/django/hooks","issue_events_url":"https://api.github.com/repos/django/django/issues/events{/number}","events_url":"https://api.github.com/repos/django/django/events","assignees_url":"https://api.github.com/repos/django/django/assignees{/user}","branches_url":"https://api.github.com/repos/django/django/branches{/branch}","tags_url":"https://api.github.com/repos/django/django/tags","blobs_url":"https://api.github.com/repos/django/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/django/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/django/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/django/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/django/django/statuses/{sha}","languages_url":"https://api.github.com/repos/django/django/languages","stargazers_url":"https://api.github.com/repos/django/django/stargazers","contributors_url":"https://api.github.com/repos/django/django/contributors","subscribers_url":"https://api.github.com/repos/django/django/subscribers","subscription_url":"https://api.github.com/repos/django/django/subscription","commits_url":"https://api.github.com/repos/django/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/django/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/django/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/django/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/django/django/contents/{+path}","compare_url":"https://api.github.com/repos/django/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/django/django/merges","archive_url":"https://api.github.com/repos/django/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/django/django/downloads","issues_url":"https://api.github.com/repos/django/django/issues{/number}","pulls_url":"https://api.github.com/repos/django/django/pulls{/number}","milestones_url":"https://api.github.com/repos/django/django/milestones{/number}","notifications_url":"https://api.github.com/repos/django/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/django/django/labels{/name}","releases_url":"https://api.github.com/repos/django/django/releases{/id}","created_at":"2012-04-28T02:47:18Z","updated_at":"2015-07-06T17:43:05Z","pushed_at":"2015-07-06T19:11:50Z","git_url":"git://github.com/django/django.git","ssh_url":"git@github.com:django/django.git","clone_url":"https://github.com/django/django.git","svn_url":"https://github.com/django/django","homepage":"https://www.djangoproject.com/","size":294380,"stargazers_count":14943,"watchers_count":14943,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5954,"mirror_url":null,"open_issues_count":75,"forks":5954,"open_issues":75,"watchers":14943,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/4889"},"html":{"href":"https://github.com/django/django/pull/4889"},"issue":{"href":"https://api.github.com/repos/django/django/issues/4889"},"comments":{"href":"https://api.github.com/repos/django/django/issues/4889/comments"},"review_comments":{"href":"https://api.github.com/repos/django/django/pulls/4889/comments"},"review_comment":{"href":"https://api.github.com/repos/django/django/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/django/django/pulls/4889/commits"},"statuses":{"href":"https://api.github.com/repos/django/django/statuses/3da1d00a792e84ac9c0885355f820efe16769fae"}}}}