{"action":"created","issue":{"url":"https://api.github.com/repos/Turfjs/turf/issues/591","repository_url":"https://api.github.com/repos/Turfjs/turf","labels_url":"https://api.github.com/repos/Turfjs/turf/issues/591/labels{/name}","comments_url":"https://api.github.com/repos/Turfjs/turf/issues/591/comments","events_url":"https://api.github.com/repos/Turfjs/turf/issues/591/events","html_url":"https://github.com/Turfjs/turf/issues/591","id":211808262,"number":591,"title":"Remove difference between two Geojson layers using Turfjs","user":{"login":"marie15","id":14139375,"avatar_url":"https://avatars3.githubusercontent.com/u/14139375?v=3","gravatar_id":"","url":"https://api.github.com/users/marie15","html_url":"https://github.com/marie15","followers_url":"https://api.github.com/users/marie15/followers","following_url":"https://api.github.com/users/marie15/following{/other_user}","gists_url":"https://api.github.com/users/marie15/gists{/gist_id}","starred_url":"https://api.github.com/users/marie15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marie15/subscriptions","organizations_url":"https://api.github.com/users/marie15/orgs","repos_url":"https://api.github.com/users/marie15/repos","events_url":"https://api.github.com/users/marie15/events{/privacy}","received_events_url":"https://api.github.com/users/marie15/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-03-03T21:35:47Z","updated_at":"2017-03-04T13:51:56Z","closed_at":null,"body":"I've draw line programmatically (not using leaflet draw) inside polygone using leaflet draw plugin on map, I want to keep only the points of polyline that are inside of polygone and remove those are outside. Using **difference** method of **Turfsjs** library, I can get the \"difference\" layer between the polygon and line, now I want to remove the difference between this layers from map and keep only the polygone and part of line that is inside the polygon. Any help is much appreciated. Thank you.\r\nHere is a code snippet:\r\n\r\nvar line = path.toGeoJSON(); var polygon = selectedPoly.toGeoJSON(); var difference, result = []; difference = turf.difference(line, polygon); if (difference) { result.push(difference); var inter = L.geoJson(result).addTo(map); }\r\n\r\nHere is a screenshot of difference method :\r\n![capturedifference](https://cloud.githubusercontent.com/assets/14139375/23579256/6849b4d8-00e1-11e7-8f69-52e8657fff6a.JPG)\r\n\r\nThis is what I want to get: \r\n![capturebefore](https://cloud.githubusercontent.com/assets/14139375/23579263/8b2e9554-00e1-11e7-9bef-daac091d2414.JPG)\r\n"},"comment":{"url":"https://api.github.com/repos/Turfjs/turf/issues/comments/284152665","html_url":"https://github.com/Turfjs/turf/issues/591#issuecomment-284152665","issue_url":"https://api.github.com/repos/Turfjs/turf/issues/591","id":284152665,"user":{"login":"marie15","id":14139375,"avatar_url":"https://avatars3.githubusercontent.com/u/14139375?v=3","gravatar_id":"","url":"https://api.github.com/users/marie15","html_url":"https://github.com/marie15","followers_url":"https://api.github.com/users/marie15/followers","following_url":"https://api.github.com/users/marie15/following{/other_user}","gists_url":"https://api.github.com/users/marie15/gists{/gist_id}","starred_url":"https://api.github.com/users/marie15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marie15/subscriptions","organizations_url":"https://api.github.com/users/marie15/orgs","repos_url":"https://api.github.com/users/marie15/repos","events_url":"https://api.github.com/users/marie15/events{/privacy}","received_events_url":"https://api.github.com/users/marie15/received_events","type":"User","site_admin":false},"created_at":"2017-03-04T13:51:55Z","updated_at":"2017-03-04T13:51:55Z","body":"@rowanwins I add screenchot to the post to be more clear"}}
{"actor":{"display_login":"marie15"}}