{"action":"created","comment":{"url":"https://api.github.com/repos/PaulLeCam/react-leaflet/pulls/comments/81285776","pull_request_review_id":2275930,"id":81285776,"diff_hunk":"@@ -0,0 +1,158 @@\n+/* @flow */\n+import React, { PropTypes, Component } from 'react'\n+import { forEach, omit, uniqueId, indexOf } from 'lodash'\n+\n+import childrenType from './types/children'\n+import mapType from './types/map'\n+import paneType from './types/pane'\n+\n+const BLACKLIST = ['tile', 'shadow', 'overlay', 'map', 'marker', 'tooltip', 'popup']\n+\n+export default class MapPane extends Component {\n+  static propTypes = {\n+    name: PropTypes.string,\n+    children: childrenType,\n+    map: mapType,\n+    zIndex: PropTypes.number,\n+    className: PropTypes.string,\n+    style: PropTypes.object,\n+    pane: paneType,\n+  };\n+\n+  static contextTypes = {\n+    map: mapType,\n+    pane: paneType,\n+  };\n+\n+  static childContextTypes = {\n+    pane: paneType,\n+  };\n+\n+  constructor ({name}) {\n+    super()\n+\n+    this.state = {\n+      _isMounted: false,\n+    }\n+\n+    this._name = name || `pane-${uniqueId()}`\n+  }\n+\n+  getChildContext () {\n+    return {\n+      pane: this._name,\n+    }\n+  }\n+\n+  componentWillMount () {\n+    const map = this.context.map || this.props.map\n+\n+    if (this._name && map && map.createPane) {\n+      const existing = this.getPane()\n+\n+      if (!existing) {\n+        map.createPane(this._name, this.getParentPane())\n+      }\n+    }\n+  }\n+\n+  componentWillReceiveProps (props) {\n+    this.setStyle(props)\n+  }\n+\n+  setStyle ({ style, zIndex } = this.props) {\n+    const pane = this.getPane()\n+\n+    if (pane) {\n+      pane.style.zIndex = zIndex || 'initial'\n+\n+      if (style) {\n+        forEach(style, (value, key) => {\n+          pane.style[key] = value\n+        })\n+      }\n+    }\n+  }\n+\n+  componentDidMount () {\n+    this.setState({\n+      _isMounted: true,\n+    })\n+\n+    this.setStyle()\n+  }\n+\n+  componentWillUnmount () {\n+    const { name } = this.props\n+\n+    if (name) {\n+      const _name = (name + '').replace(/-*pane/gi, '')\n+\n+      if (indexOf(BLACKLIST, _name) >= 0) {","path":"src/MapPane.js","position":null,"original_position":91,"commit_id":"a6b6c6ffdd3d3190f63efcf9d6b11738b43f7124","original_commit_id":"3f9c9d16fb8259a5d6ec05c3d1b2782a583e51cf","user":{"login":"PaulLeCam","id":790995,"avatar_url":"https://avatars.githubusercontent.com/u/790995?v=3","gravatar_id":"","url":"https://api.github.com/users/PaulLeCam","html_url":"https://github.com/PaulLeCam","followers_url":"https://api.github.com/users/PaulLeCam/followers","following_url":"https://api.github.com/users/PaulLeCam/following{/other_user}","gists_url":"https://api.github.com/users/PaulLeCam/gists{/gist_id}","starred_url":"https://api.github.com/users/PaulLeCam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaulLeCam/subscriptions","organizations_url":"https://api.github.com/users/PaulLeCam/orgs","repos_url":"https://api.github.com/users/PaulLeCam/repos","events_url":"https://api.github.com/users/PaulLeCam/events{/privacy}","received_events_url":"https://api.github.com/users/PaulLeCam/received_events","type":"User","site_admin":false},"body":"I don't like the idea of allowing to update Leaflet's default panes unless there is a way to restore them to their original styles, that would create unexpected behavior, so I'd rather have this library simply prevent from overriding these panes.\r\nRegarding having \"`<Pane name='myCustomPane' />` in two places\", same I don't think it should be possible, even if it is technically possible I think it would only lead to unexpected behavior when trying to set different styles in each component for example.","created_at":"2016-09-30T06:46:36Z","updated_at":"2016-09-30T06:46:36Z","html_url":"https://github.com/PaulLeCam/react-leaflet/pull/227#discussion_r81285776","pull_request_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/pulls/227","_links":{"self":{"href":"https://api.github.com/repos/PaulLeCam/react-leaflet/pulls/comments/81285776"},"html":{"href":"https://github.com/PaulLeCam/react-leaflet/pull/227#discussion_r81285776"},"pull_request":{"href":"https://api.github.com/repos/PaulLeCam/react-leaflet/pulls/227"}}},"pull_request":{"url":"https://api.github.com/repos/PaulLeCam/react-leaflet/pulls/227","id":86545013,"html_url":"https://github.com/PaulLeCam/react-leaflet/pull/227","diff_url":"https://github.com/PaulLeCam/react-leaflet/pull/227.diff","patch_url":"https://github.com/PaulLeCam/react-leaflet/pull/227.patch","issue_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/issues/227","number":227,"state":"open","locked":false,"title":"Leaflet Map Panes","user":{"login":"rjdestigter","id":14314519,"avatar_url":"https://avatars.githubusercontent.com/u/14314519?v=3","gravatar_id":"","url":"https://api.github.com/users/rjdestigter","html_url":"https://github.com/rjdestigter","followers_url":"https://api.github.com/users/rjdestigter/followers","following_url":"https://api.github.com/users/rjdestigter/following{/other_user}","gists_url":"https://api.github.com/users/rjdestigter/gists{/gist_id}","starred_url":"https://api.github.com/users/rjdestigter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjdestigter/subscriptions","organizations_url":"https://api.github.com/users/rjdestigter/orgs","repos_url":"https://api.github.com/users/rjdestigter/repos","events_url":"https://api.github.com/users/rjdestigter/events{/privacy}","received_events_url":"https://api.github.com/users/rjdestigter/received_events","type":"User","site_admin":false},"body":"Developed component implementing Leaflet's new 'panes' concept.\r\n\r\nComponent name: `MapPane`\r\n\r\nAccepted props:\r\n-  `className`\r\n- `style`\r\n- `zIndex`\r\n- `name` (Not required, unique id wiill be created if not passed.)\r\n\r\n`Does Leaflet allow to override its existing panes?`\r\nNo it does not seem like that. I've allowed passing a \"blacklisted\" name as prop. However if the name of the pane matches up with a pane leaflet itself creates, it is not removed on `componentWillUnMount`\r\n\r\nSubsequently this does allow developers to change the zIndex + style of existing leaflet panes.\r\n\r\nLifecycle:\r\n- `constructor` will create a unique id if no name is passed\r\n- `componentWillMount` will check if the pane exists or not and call `map.createPane` if not.\r\n- `componentDidMount` will set the states `isMounted` to true and update the (created) pane's style\r\n- `componentWillUnmount` will check if the pane's name is blacklisted. If not it will remove the pane from the DOM and leaflet.\r\n\r\n- Added documentation and example.","created_at":"2016-09-23T16:46:33Z","updated_at":"2016-09-30T06:46:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8bbd0512bd2d7741e3bbc8e476ad8dc50ba0d54d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/pulls/227/commits","review_comments_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/pulls/227/comments","review_comment_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/issues/227/comments","statuses_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/statuses/a6b6c6ffdd3d3190f63efcf9d6b11738b43f7124","head":{"label":"rjdestigter:LeafletMapPanes","ref":"LeafletMapPanes","sha":"a6b6c6ffdd3d3190f63efcf9d6b11738b43f7124","user":{"login":"rjdestigter","id":14314519,"avatar_url":"https://avatars.githubusercontent.com/u/14314519?v=3","gravatar_id":"","url":"https://api.github.com/users/rjdestigter","html_url":"https://github.com/rjdestigter","followers_url":"https://api.github.com/users/rjdestigter/followers","following_url":"https://api.github.com/users/rjdestigter/following{/other_user}","gists_url":"https://api.github.com/users/rjdestigter/gists{/gist_id}","starred_url":"https://api.github.com/users/rjdestigter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjdestigter/subscriptions","organizations_url":"https://api.github.com/users/rjdestigter/orgs","repos_url":"https://api.github.com/users/rjdestigter/repos","events_url":"https://api.github.com/users/rjdestigter/events{/privacy}","received_events_url":"https://api.github.com/users/rjdestigter/received_events","type":"User","site_admin":false},"repo":{"id":67812346,"name":"react-leaflet","full_name":"rjdestigter/react-leaflet","owner":{"login":"rjdestigter","id":14314519,"avatar_url":"https://avatars.githubusercontent.com/u/14314519?v=3","gravatar_id":"","url":"https://api.github.com/users/rjdestigter","html_url":"https://github.com/rjdestigter","followers_url":"https://api.github.com/users/rjdestigter/followers","following_url":"https://api.github.com/users/rjdestigter/following{/other_user}","gists_url":"https://api.github.com/users/rjdestigter/gists{/gist_id}","starred_url":"https://api.github.com/users/rjdestigter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjdestigter/subscriptions","organizations_url":"https://api.github.com/users/rjdestigter/orgs","repos_url":"https://api.github.com/users/rjdestigter/repos","events_url":"https://api.github.com/users/rjdestigter/events{/privacy}","received_events_url":"https://api.github.com/users/rjdestigter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rjdestigter/react-leaflet","description":"React components for Leaflet maps","fork":true,"url":"https://api.github.com/repos/rjdestigter/react-leaflet","forks_url":"https://api.github.com/repos/rjdestigter/react-leaflet/forks","keys_url":"https://api.github.com/repos/rjdestigter/react-leaflet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rjdestigter/react-leaflet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rjdestigter/react-leaflet/teams","hooks_url":"https://api.github.com/repos/rjdestigter/react-leaflet/hooks","issue_events_url":"https://api.github.com/repos/rjdestigter/react-leaflet/issues/events{/number}","events_url":"https://api.github.com/repos/rjdestigter/react-leaflet/events","assignees_url":"https://api.github.com/repos/rjdestigter/react-leaflet/assignees{/user}","branches_url":"https://api.github.com/repos/rjdestigter/react-leaflet/branches{/branch}","tags_url":"https://api.github.com/repos/rjdestigter/react-leaflet/tags","blobs_url":"https://api.github.com/repos/rjdestigter/react-leaflet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rjdestigter/react-leaflet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rjdestigter/react-leaflet/git/refs{/sha}","trees_url":"https://api.github.com/repos/rjdestigter/react-leaflet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rjdestigter/react-leaflet/statuses/{sha}","languages_url":"https://api.github.com/repos/rjdestigter/react-leaflet/languages","stargazers_url":"https://api.github.com/repos/rjdestigter/react-leaflet/stargazers","contributors_url":"https://api.github.com/repos/rjdestigter/react-leaflet/contributors","subscribers_url":"https://api.github.com/repos/rjdestigter/react-leaflet/subscribers","subscription_url":"https://api.github.com/repos/rjdestigter/react-leaflet/subscription","commits_url":"https://api.github.com/repos/rjdestigter/react-leaflet/commits{/sha}","git_commits_url":"https://api.github.com/repos/rjdestigter/react-leaflet/git/commits{/sha}","comments_url":"https://api.github.com/repos/rjdestigter/react-leaflet/comments{/number}","issue_comment_url":"https://api.github.com/repos/rjdestigter/react-leaflet/issues/comments{/number}","contents_url":"https://api.github.com/repos/rjdestigter/react-leaflet/contents/{+path}","compare_url":"https://api.github.com/repos/rjdestigter/react-leaflet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rjdestigter/react-leaflet/merges","archive_url":"https://api.github.com/repos/rjdestigter/react-leaflet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rjdestigter/react-leaflet/downloads","issues_url":"https://api.github.com/repos/rjdestigter/react-leaflet/issues{/number}","pulls_url":"https://api.github.com/repos/rjdestigter/react-leaflet/pulls{/number}","milestones_url":"https://api.github.com/repos/rjdestigter/react-leaflet/milestones{/number}","notifications_url":"https://api.github.com/repos/rjdestigter/react-leaflet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rjdestigter/react-leaflet/labels{/name}","releases_url":"https://api.github.com/repos/rjdestigter/react-leaflet/releases{/id}","deployments_url":"https://api.github.com/repos/rjdestigter/react-leaflet/deployments","created_at":"2016-09-09T15:55:03Z","updated_at":"2016-09-09T15:55:04Z","pushed_at":"2016-09-29T18:53:28Z","git_url":"git://github.com/rjdestigter/react-leaflet.git","ssh_url":"git@github.com:rjdestigter/react-leaflet.git","clone_url":"https://github.com/rjdestigter/react-leaflet.git","svn_url":"https://github.com/rjdestigter/react-leaflet","homepage":null,"size":2989,"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":"PaulLeCam:next","ref":"next","sha":"b0e95ff0d45b88a5e6d995114642d3114dc4b063","user":{"login":"PaulLeCam","id":790995,"avatar_url":"https://avatars.githubusercontent.com/u/790995?v=3","gravatar_id":"","url":"https://api.github.com/users/PaulLeCam","html_url":"https://github.com/PaulLeCam","followers_url":"https://api.github.com/users/PaulLeCam/followers","following_url":"https://api.github.com/users/PaulLeCam/following{/other_user}","gists_url":"https://api.github.com/users/PaulLeCam/gists{/gist_id}","starred_url":"https://api.github.com/users/PaulLeCam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaulLeCam/subscriptions","organizations_url":"https://api.github.com/users/PaulLeCam/orgs","repos_url":"https://api.github.com/users/PaulLeCam/repos","events_url":"https://api.github.com/users/PaulLeCam/events{/privacy}","received_events_url":"https://api.github.com/users/PaulLeCam/received_events","type":"User","site_admin":false},"repo":{"id":22571796,"name":"react-leaflet","full_name":"PaulLeCam/react-leaflet","owner":{"login":"PaulLeCam","id":790995,"avatar_url":"https://avatars.githubusercontent.com/u/790995?v=3","gravatar_id":"","url":"https://api.github.com/users/PaulLeCam","html_url":"https://github.com/PaulLeCam","followers_url":"https://api.github.com/users/PaulLeCam/followers","following_url":"https://api.github.com/users/PaulLeCam/following{/other_user}","gists_url":"https://api.github.com/users/PaulLeCam/gists{/gist_id}","starred_url":"https://api.github.com/users/PaulLeCam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaulLeCam/subscriptions","organizations_url":"https://api.github.com/users/PaulLeCam/orgs","repos_url":"https://api.github.com/users/PaulLeCam/repos","events_url":"https://api.github.com/users/PaulLeCam/events{/privacy}","received_events_url":"https://api.github.com/users/PaulLeCam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PaulLeCam/react-leaflet","description":"React components for Leaflet maps","fork":false,"url":"https://api.github.com/repos/PaulLeCam/react-leaflet","forks_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/forks","keys_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/teams","hooks_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/hooks","issue_events_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/issues/events{/number}","events_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/events","assignees_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/assignees{/user}","branches_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/branches{/branch}","tags_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/tags","blobs_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/git/refs{/sha}","trees_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/statuses/{sha}","languages_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/languages","stargazers_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/stargazers","contributors_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/contributors","subscribers_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/subscribers","subscription_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/subscription","commits_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/commits{/sha}","git_commits_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/git/commits{/sha}","comments_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/comments{/number}","issue_comment_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/issues/comments{/number}","contents_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/contents/{+path}","compare_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/merges","archive_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/downloads","issues_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/issues{/number}","pulls_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/pulls{/number}","milestones_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/milestones{/number}","notifications_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/labels{/name}","releases_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/releases{/id}","deployments_url":"https://api.github.com/repos/PaulLeCam/react-leaflet/deployments","created_at":"2014-08-03T09:16:09Z","updated_at":"2016-09-30T03:28:51Z","pushed_at":"2016-09-30T02:02:10Z","git_url":"git://github.com/PaulLeCam/react-leaflet.git","ssh_url":"git@github.com:PaulLeCam/react-leaflet.git","clone_url":"https://github.com/PaulLeCam/react-leaflet.git","svn_url":"https://github.com/PaulLeCam/react-leaflet","homepage":null,"size":3189,"stargazers_count":701,"watchers_count":701,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":140,"mirror_url":null,"open_issues_count":6,"forks":140,"open_issues":6,"watchers":701,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PaulLeCam/react-leaflet/pulls/227"},"html":{"href":"https://github.com/PaulLeCam/react-leaflet/pull/227"},"issue":{"href":"https://api.github.com/repos/PaulLeCam/react-leaflet/issues/227"},"comments":{"href":"https://api.github.com/repos/PaulLeCam/react-leaflet/issues/227/comments"},"review_comments":{"href":"https://api.github.com/repos/PaulLeCam/react-leaflet/pulls/227/comments"},"review_comment":{"href":"https://api.github.com/repos/PaulLeCam/react-leaflet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PaulLeCam/react-leaflet/pulls/227/commits"},"statuses":{"href":"https://api.github.com/repos/PaulLeCam/react-leaflet/statuses/a6b6c6ffdd3d3190f63efcf9d6b11738b43f7124"}}}}
{"actor":{"display_login":"PaulLeCam"}}