Add recursive to L.LayerGroup.eachLayer()
See original GitHub issueIt might be useful to add an new option to L.LayerGroup.eachLayer() method for recursive behavior? This could greatly improve management and research possibilities on complex data.
for example:
....geojson loading...
var geo1 = L.geoJson(Geo1);
var geo2 = L.geoJson(Geo2);
var geo3 = L.geoJson(Geo3);
var geo4 = L.geoJson(Geo4);
var group1 = L.LayerGroup([geo1, geo2]);
var group2 = L.LayerGroup([geo3, geo4]);
var groupAll = L.LayerGroup([group1, group2]);
groupAll.eachLayer(function(lay, layParent) {
console.log(lay, layParent);
}, {
recursive: true
//new option
})
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Leaflet - tell whether an object a layer or a group
L.LayerGroup can contain other LayerGroups, pretty confusing. I made this generic solution for recursively traversing a layergroup in ...
Read more >L.LayerGroup
Iterates over the layers of the group, optionally specifying context of the iterator function. group.eachLayer(function (layer) { layer.bindPopup('Hello'); });.
Read more >adding layers in layer group dynamically to layer control in ...
In your ajax callback, you should find layerGroup = L.layerGroup() .addLayer(vector1)) .addLayer(vector2)) .addLayer(vector3)) .
Read more >Computing Receptive Fields of Convolutional Neural Networks
Each layer l l 's spatial configuration is parameterized by 4 ... This equation can be used in a recursive algorithm to compute...
Read more >16. Trees 3: Construction of Dynamic Binary Trees
Layer structure; Data for nodes; Fill for "missing" nodes ... RClone() is a recursive method (and private) method that builds a deep copy...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I propose something like:
Run method on all LayerGroup tree leaves but not on branches.
Leaflet.draw as well… http://gis.stackexchange.com/questions/203540/how-to-edit-an-existing-layer-using-leaflet