geoext / geoext2

GeoExt 2 — JavaScript Toolkit for Rich Web Mapping Applications
http://geoext.github.io/geoext2/
Other
142 stars 106 forks source link

Using group optional attribute to create an hierarchical layer tree #355

Open jgrocha opened 9 years ago

jgrocha commented 9 years ago

Hi devs,

I recovered these two classes that help create a layer tree, from an group attribute. I also add an example of usage, to geoext2/examples/tree/.

The only change in the existing code proposed in the PR is an additional protection (if clause) in src/GeoExt/tree/Util.js, updateLayerVisibilityByNode function, to make sure that we have a layer associated with the node before checking the layer's visibility. I think this test is necessary, since we might have nodes in the tree (not leafs) without a layer.

The two classes proposed in this PR are: GeoExt.tree.LayerTreeBuilder that extends GeoExt.tree.Panel GeoExt.tree.LayerGroupContainer that extends GeoExt.tree.LayerContainer

Comments are welcome.

marcjansen commented 9 years ago

I currently don't have time to look into this, sorry. I hope to find time for this next week. Others are free to revoew of course.

chrismayer commented 9 years ago

Hi @jgrocha, thanks a lot for your contribution! This seems to be a great addition for the tree package of GeoExt.

Besides some minor issues which I addressed directly as line comments (see above) I have some major points which should be done before we can merge this:

marcjansen commented 8 years ago

Hey @jgrocha do you think you can tackle the comments of @chrismayer?