{"action":"created","issue":{"url":"https://api.github.com/repos/tombatossals/angular-leaflet-directive/issues/281","labels_url":"https://api.github.com/repos/tombatossals/angular-leaflet-directive/issues/281/labels{/name}","comments_url":"https://api.github.com/repos/tombatossals/angular-leaflet-directive/issues/281/comments","events_url":"https://api.github.com/repos/tombatossals/angular-leaflet-directive/issues/281/events","html_url":"https://github.com/tombatossals/angular-leaflet-directive/issues/281","id":27358773,"number":281,"title":"FeatureGroups","user":{"login":"iandeherdt","id":2690641,"avatar_url":"https://avatars.githubusercontent.com/u/2690641?v=3","gravatar_id":"","url":"https://api.github.com/users/iandeherdt","html_url":"https://github.com/iandeherdt","followers_url":"https://api.github.com/users/iandeherdt/followers","following_url":"https://api.github.com/users/iandeherdt/following{/other_user}","gists_url":"https://api.github.com/users/iandeherdt/gists{/gist_id}","starred_url":"https://api.github.com/users/iandeherdt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iandeherdt/subscriptions","organizations_url":"https://api.github.com/users/iandeherdt/orgs","repos_url":"https://api.github.com/users/iandeherdt/repos","events_url":"https://api.github.com/users/iandeherdt/events{/privacy}","received_events_url":"https://api.github.com/users/iandeherdt/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-02-11T15:57:52Z","updated_at":"2015-06-21T11:15:25Z","closed_at":"2015-06-21T11:15:25Z","body":"Hello,\r\n\r\nI can't find a way to create multiple layers and add them as features to the map. Could it be that this functionality is still missing?\r\n\r\nI did the following in a test project using default leaflet;\r\n\r\n   var leidingenLayer = new L.FeatureGroup(leidingenGEOJSON);\r\n    var hydrantenLayer = new L.FeatureGroup(hydrantenGEOJSON);\r\n    var glasbollenLayer = new L.LayerGroup(markers);\r\n    var hondenloopZoneLayer = new L.LayerGroup(circles);\r\n    \r\n    var features = {\r\n        \"glasbollen\": glasbollenLayer,\r\n        \"hondenloopzones\": hondenloopZoneLayer,\r\n        \"hydranten\": hydrantenLayer,\r\n        \"leidingen\": leidingenLayer\r\n    };\r\n   \r\n   \r\n    map.addLayer(glasbollenLayer);\r\n    map.addLayer(hondenloopZoneLayer);\r\n    map.addLayer(hydrantenLayer);\r\n    map.addLayer(leidingenLayer);\r\n    var control = new L.Control.Layers(features);\r\n    map.addControl(control);\r\n\r\nBasically i want multiple GEOJSON layers that can be turned on and off via javascript and the layer selector.\r\n\r\nThanks in advance,\r\n\r\nIan\r\n"},"comment":{"url":"https://api.github.com/repos/tombatossals/angular-leaflet-directive/issues/comments/113885578","html_url":"https://github.com/tombatossals/angular-leaflet-directive/issues/281#issuecomment-113885578","issue_url":"https://api.github.com/repos/tombatossals/angular-leaflet-directive/issues/281","id":113885578,"user":{"login":"tombatossals","id":124169,"avatar_url":"https://avatars.githubusercontent.com/u/124169?v=3","gravatar_id":"","url":"https://api.github.com/users/tombatossals","html_url":"https://github.com/tombatossals","followers_url":"https://api.github.com/users/tombatossals/followers","following_url":"https://api.github.com/users/tombatossals/following{/other_user}","gists_url":"https://api.github.com/users/tombatossals/gists{/gist_id}","starred_url":"https://api.github.com/users/tombatossals/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tombatossals/subscriptions","organizations_url":"https://api.github.com/users/tombatossals/orgs","repos_url":"https://api.github.com/users/tombatossals/repos","events_url":"https://api.github.com/users/tombatossals/events{/privacy}","received_events_url":"https://api.github.com/users/tombatossals/received_events","type":"User","site_admin":false},"created_at":"2015-06-21T11:15:25Z","updated_at":"2015-06-21T11:15:25Z","body":"Hi, you can add multiple GeoJON layers now with the nested GeoJSON functionality:\r\n\r\nhttp://tombatossals.github.io/angular-leaflet-directive/examples/0000-viewer.html#/basic/geojson-nested-example"}}