-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using group optional attribute to create an hierarchical layer tree #355
base: master
Are you sure you want to change the base?
Conversation
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. |
} | ||
|
||
var groupString = layer.options.group || ""; | ||
var group = groupString.split('/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this happen in after it has been ensured groupString !== ""
in line 175?
Hi @jgrocha, 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:
|
Hey @jgrocha do you think you can tackle the comments of @chrismayer? |
Hi devs,
I recovered these two classes that help create a layer tree, from an
group
attribute. I also add an example of usage, togeoext2/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 extendsGeoExt.tree.Panel
GeoExt.tree.LayerGroupContainer
that extendsGeoExt.tree.LayerContainer
Comments are welcome.