{"action":"created","comment":{"url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/pulls/comments/31886580","id":31886580,"diff_hunk":"@@ -44,11 +44,49 @@ L.MarkerGeneralizeGroup = L.FeatureGroup.extend({\n \n         this._zoomReady = {};\n \n+        this.setMaxZoom(options.maxZoom);\n+        this.setMinZoom(options.minZoom);\n+\n         this.on('invalidationFinish', function() {\n             this._map.getPanes().markerPane.style.display = 'block';\n         });\n     },\n \n+    setMaxZoom: function(zoom) {\n+        if (isNaN(zoom) || zoom > 19) {\n+            this._maxZoom = 19;\n+            this._userMaxZoom = false;\n+        } else {\n+            this._maxZoom = zoom;\n+            this._userMaxZoom = true;\n+        }","path":"src/Generalize.js","position":19,"original_position":19,"commit_id":"0cf6982c5706329ea7d1632b0621cf5336e0cfd1","original_commit_id":"0cf6982c5706329ea7d1632b0621cf5336e0cfd1","user":{"login":"bardt","id":633908,"avatar_url":"https://avatars.githubusercontent.com/u/633908?v=3","gravatar_id":"","url":"https://api.github.com/users/bardt","html_url":"https://github.com/bardt","followers_url":"https://api.github.com/users/bardt/followers","following_url":"https://api.github.com/users/bardt/following{/other_user}","gists_url":"https://api.github.com/users/bardt/gists{/gist_id}","starred_url":"https://api.github.com/users/bardt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bardt/subscriptions","organizations_url":"https://api.github.com/users/bardt/orgs","repos_url":"https://api.github.com/users/bardt/repos","events_url":"https://api.github.com/users/bardt/events{/privacy}","received_events_url":"https://api.github.com/users/bardt/received_events","type":"User","site_admin":false},"body":"By the way, what happens if we don't pass zooms in options at all? We will assign `_userMaxZoom` to `true` instead of just ignoring it.","created_at":"2015-06-08T04:27:42Z","updated_at":"2015-06-08T04:27:42Z","html_url":"https://github.com/2gis/MarkerGeneralizationPlugin/pull/20#discussion_r31886580","pull_request_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/pulls/comments/31886580"},"html":{"href":"https://github.com/2gis/MarkerGeneralizationPlugin/pull/20#discussion_r31886580"},"pull_request":{"href":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/pulls/20","id":37005107,"html_url":"https://github.com/2gis/MarkerGeneralizationPlugin/pull/20","diff_url":"https://github.com/2gis/MarkerGeneralizationPlugin/pull/20.diff","patch_url":"https://github.com/2gis/MarkerGeneralizationPlugin/pull/20.patch","issue_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/issues/20","number":20,"state":"open","locked":false,"title":"Add setMaxZoom method, fix bug with not prepared zoom","user":{"login":"ilfa","id":1009415,"avatar_url":"https://avatars.githubusercontent.com/u/1009415?v=3","gravatar_id":"","url":"https://api.github.com/users/ilfa","html_url":"https://github.com/ilfa","followers_url":"https://api.github.com/users/ilfa/followers","following_url":"https://api.github.com/users/ilfa/following{/other_user}","gists_url":"https://api.github.com/users/ilfa/gists{/gist_id}","starred_url":"https://api.github.com/users/ilfa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilfa/subscriptions","organizations_url":"https://api.github.com/users/ilfa/orgs","repos_url":"https://api.github.com/users/ilfa/repos","events_url":"https://api.github.com/users/ilfa/events{/privacy}","received_events_url":"https://api.github.com/users/ilfa/received_events","type":"User","site_admin":false},"body":"Fix problems from issue #19 ","created_at":"2015-06-05T06:49:00Z","updated_at":"2015-06-08T04:27:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"279f8034e0dcbc7104e8b15efd7b74449d94a749","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/pulls/20/commits","review_comments_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/pulls/20/comments","review_comment_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/issues/20/comments","statuses_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/statuses/0cf6982c5706329ea7d1632b0621cf5336e0cfd1","head":{"label":"2gis:add/setMaxZoom","ref":"add/setMaxZoom","sha":"0cf6982c5706329ea7d1632b0621cf5336e0cfd1","user":{"login":"2gis","id":1481435,"avatar_url":"https://avatars.githubusercontent.com/u/1481435?v=3","gravatar_id":"","url":"https://api.github.com/users/2gis","html_url":"https://github.com/2gis","followers_url":"https://api.github.com/users/2gis/followers","following_url":"https://api.github.com/users/2gis/following{/other_user}","gists_url":"https://api.github.com/users/2gis/gists{/gist_id}","starred_url":"https://api.github.com/users/2gis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2gis/subscriptions","organizations_url":"https://api.github.com/users/2gis/orgs","repos_url":"https://api.github.com/users/2gis/repos","events_url":"https://api.github.com/users/2gis/events{/privacy}","received_events_url":"https://api.github.com/users/2gis/received_events","type":"Organization","site_admin":false},"repo":{"id":30915211,"name":"MarkerGeneralizationPlugin","full_name":"2gis/MarkerGeneralizationPlugin","owner":{"login":"2gis","id":1481435,"avatar_url":"https://avatars.githubusercontent.com/u/1481435?v=3","gravatar_id":"","url":"https://api.github.com/users/2gis","html_url":"https://github.com/2gis","followers_url":"https://api.github.com/users/2gis/followers","following_url":"https://api.github.com/users/2gis/following{/other_user}","gists_url":"https://api.github.com/users/2gis/gists{/gist_id}","starred_url":"https://api.github.com/users/2gis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2gis/subscriptions","organizations_url":"https://api.github.com/users/2gis/orgs","repos_url":"https://api.github.com/users/2gis/repos","events_url":"https://api.github.com/users/2gis/events{/privacy}","received_events_url":"https://api.github.com/users/2gis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/2gis/MarkerGeneralizationPlugin","description":"Provides custom marker generalization for 2gis maps and Leaflet.","fork":false,"url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin","forks_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/forks","keys_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/teams","hooks_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/hooks","issue_events_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/issues/events{/number}","events_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/events","assignees_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/assignees{/user}","branches_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/branches{/branch}","tags_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/tags","blobs_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/statuses/{sha}","languages_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/languages","stargazers_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/stargazers","contributors_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/contributors","subscribers_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/subscribers","subscription_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/subscription","commits_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/contents/{+path}","compare_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/merges","archive_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/downloads","issues_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/issues{/number}","pulls_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/pulls{/number}","milestones_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/milestones{/number}","notifications_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/labels{/name}","releases_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/releases{/id}","created_at":"2015-02-17T12:02:35Z","updated_at":"2015-05-05T05:56:39Z","pushed_at":"2015-06-05T07:29:57Z","git_url":"git://github.com/2gis/MarkerGeneralizationPlugin.git","ssh_url":"git@github.com:2gis/MarkerGeneralizationPlugin.git","clone_url":"https://github.com/2gis/MarkerGeneralizationPlugin.git","svn_url":"https://github.com/2gis/MarkerGeneralizationPlugin","homepage":null,"size":1232,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":2,"default_branch":"master"}},"base":{"label":"2gis:master","ref":"master","sha":"0f49f806ee36f0a31fa9e131fcd9e63696ba9008","user":{"login":"2gis","id":1481435,"avatar_url":"https://avatars.githubusercontent.com/u/1481435?v=3","gravatar_id":"","url":"https://api.github.com/users/2gis","html_url":"https://github.com/2gis","followers_url":"https://api.github.com/users/2gis/followers","following_url":"https://api.github.com/users/2gis/following{/other_user}","gists_url":"https://api.github.com/users/2gis/gists{/gist_id}","starred_url":"https://api.github.com/users/2gis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2gis/subscriptions","organizations_url":"https://api.github.com/users/2gis/orgs","repos_url":"https://api.github.com/users/2gis/repos","events_url":"https://api.github.com/users/2gis/events{/privacy}","received_events_url":"https://api.github.com/users/2gis/received_events","type":"Organization","site_admin":false},"repo":{"id":30915211,"name":"MarkerGeneralizationPlugin","full_name":"2gis/MarkerGeneralizationPlugin","owner":{"login":"2gis","id":1481435,"avatar_url":"https://avatars.githubusercontent.com/u/1481435?v=3","gravatar_id":"","url":"https://api.github.com/users/2gis","html_url":"https://github.com/2gis","followers_url":"https://api.github.com/users/2gis/followers","following_url":"https://api.github.com/users/2gis/following{/other_user}","gists_url":"https://api.github.com/users/2gis/gists{/gist_id}","starred_url":"https://api.github.com/users/2gis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2gis/subscriptions","organizations_url":"https://api.github.com/users/2gis/orgs","repos_url":"https://api.github.com/users/2gis/repos","events_url":"https://api.github.com/users/2gis/events{/privacy}","received_events_url":"https://api.github.com/users/2gis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/2gis/MarkerGeneralizationPlugin","description":"Provides custom marker generalization for 2gis maps and Leaflet.","fork":false,"url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin","forks_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/forks","keys_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/teams","hooks_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/hooks","issue_events_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/issues/events{/number}","events_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/events","assignees_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/assignees{/user}","branches_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/branches{/branch}","tags_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/tags","blobs_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/statuses/{sha}","languages_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/languages","stargazers_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/stargazers","contributors_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/contributors","subscribers_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/subscribers","subscription_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/subscription","commits_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/contents/{+path}","compare_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/merges","archive_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/downloads","issues_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/issues{/number}","pulls_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/pulls{/number}","milestones_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/milestones{/number}","notifications_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/labels{/name}","releases_url":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/releases{/id}","created_at":"2015-02-17T12:02:35Z","updated_at":"2015-05-05T05:56:39Z","pushed_at":"2015-06-05T07:29:57Z","git_url":"git://github.com/2gis/MarkerGeneralizationPlugin.git","ssh_url":"git@github.com:2gis/MarkerGeneralizationPlugin.git","clone_url":"https://github.com/2gis/MarkerGeneralizationPlugin.git","svn_url":"https://github.com/2gis/MarkerGeneralizationPlugin","homepage":null,"size":1232,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/pulls/20"},"html":{"href":"https://github.com/2gis/MarkerGeneralizationPlugin/pull/20"},"issue":{"href":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/issues/20"},"comments":{"href":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/2gis/MarkerGeneralizationPlugin/statuses/0cf6982c5706329ea7d1632b0621cf5336e0cfd1"}}}}