{"action":"created","issue":{"url":"https://api.github.com/repos/oliverroick/Leaflet.Deflate/issues/47","repository_url":"https://api.github.com/repos/oliverroick/Leaflet.Deflate","labels_url":"https://api.github.com/repos/oliverroick/Leaflet.Deflate/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/oliverroick/Leaflet.Deflate/issues/47/comments","events_url":"https://api.github.com/repos/oliverroick/Leaflet.Deflate/issues/47/events","html_url":"https://github.com/oliverroick/Leaflet.Deflate/issues/47","id":330408774,"node_id":"MDU6SXNzdWUzMzA0MDg3NzQ=","number":47,"title":"Calling clearLayers() not clearing the underlying feature layer","user":{"login":"BARNZ","id":2202345,"node_id":"MDQ6VXNlcjIyMDIzNDU=","avatar_url":"https://avatars1.githubusercontent.com/u/2202345?v=4","gravatar_id":"","url":"https://api.github.com/users/BARNZ","html_url":"https://github.com/BARNZ","followers_url":"https://api.github.com/users/BARNZ/followers","following_url":"https://api.github.com/users/BARNZ/following{/other_user}","gists_url":"https://api.github.com/users/BARNZ/gists{/gist_id}","starred_url":"https://api.github.com/users/BARNZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BARNZ/subscriptions","organizations_url":"https://api.github.com/users/BARNZ/orgs","repos_url":"https://api.github.com/users/BARNZ/repos","events_url":"https://api.github.com/users/BARNZ/events{/privacy}","received_events_url":"https://api.github.com/users/BARNZ/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-07T19:40:44Z","updated_at":"2018-06-07T21:19:35Z","closed_at":null,"author_association":"NONE","body":"    var features = L.deflate({\r\n        markerCluster: true,\r\n        markerOptions: ...\r\n    }).addTo(map);\r\n\r\n    features.clearLayers();\r\n\r\nCalling `clearLayers()` does not also clear any layers generated internally by the plugin. Have to manually call `features._featureGroup.clearLayers()`\r\n\r\nNot doing so in my case results in duplicated markers when clustering since I clear the deflate layer before downloading and adding in new geometry to the existing deflate layer."},"comment":{"url":"https://api.github.com/repos/oliverroick/Leaflet.Deflate/issues/comments/395568584","html_url":"https://github.com/oliverroick/Leaflet.Deflate/issues/47#issuecomment-395568584","issue_url":"https://api.github.com/repos/oliverroick/Leaflet.Deflate/issues/47","id":395568584,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTU2ODU4NA==","user":{"login":"BARNZ","id":2202345,"node_id":"MDQ6VXNlcjIyMDIzNDU=","avatar_url":"https://avatars1.githubusercontent.com/u/2202345?v=4","gravatar_id":"","url":"https://api.github.com/users/BARNZ","html_url":"https://github.com/BARNZ","followers_url":"https://api.github.com/users/BARNZ/followers","following_url":"https://api.github.com/users/BARNZ/following{/other_user}","gists_url":"https://api.github.com/users/BARNZ/gists{/gist_id}","starred_url":"https://api.github.com/users/BARNZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BARNZ/subscriptions","organizations_url":"https://api.github.com/users/BARNZ/orgs","repos_url":"https://api.github.com/users/BARNZ/repos","events_url":"https://api.github.com/users/BARNZ/events{/privacy}","received_events_url":"https://api.github.com/users/BARNZ/received_events","type":"User","site_admin":false},"created_at":"2018-06-07T21:19:35Z","updated_at":"2018-06-07T21:19:35Z","author_association":"NONE","body":"I found I have to also empty the `_allLayers` array as well.\r\n\r\nMaybe `clearLayers()` could be extended in the deflate layer to handle this?"}}
{"actor":{"display_login":"BARNZ"}}