Thanks both of you for your replies.

Chris is correct about the version. In the current release version (2.0.3) onLayerVisibilityChanged was in the LayerNode class https://github.com/geoext/geoext2/blob/v2.0.3/src/GeoExt/tree/LayerNode.js
The GeoExt.tree.Util class was introduced in 2.1.0-alpha.1

The issue is that all the parameter nodes are bound to the same layer, so if several nodes are switched on (representing several parameters), and then one is switched off in the updateLayerVisibilityByNode function

checked != node.get('layer').getVisibility() // checked is false and layer visibility is true

So then

layer.setVisibility(checked); // is called, and layer is hidden even though other nodes are still switched on, nodes all switch off as they are in sync with the layer

This is not the case in http://api.geoext.org/1.1/examples/tree.html (see Tasmanaia (Group Layer)), which is the functionality I'm trying to bring back.

I had hoped to update a fork of GeoExt with a working example (currently test code is in my application), but here are a few links on the current approach (basically updating the GeoExt 1 classes):

ParameterLayerContainer - https://gist.github.com/geographika/d04ff102b1803042b9fb

LayerParamNode - https://gist.github.com/geographika/de7f30b255fd9d24335c
It is this class that it would be useful to handle layer visibility itself.

I also have a custom ParameterLoader class that will be specific to my application as it loads parameters and aliases from records in a custom store. This will be kept separate from the GeoExt library but including it here for reference.
ParameterLoader - https://gist.github.com/geographika/af6faab6587cc7768ec4

I hope the above makes sense!

Regards,

Seth

On 04/09/2015 10:50, Christian Mayer wrote:
Hi Seth, hi Marc,

I guess Seth means the difference between v2.0.x and v2.1. To get the compatibility with ExtJS 5 we had to rewrite some parts of tree structure. One thing was to introduce a util-class which handles visibility of the layers according to the treenode's checked state (as Seth described). What I don't understand is the thing that all "param-layers" turn off whenever any of the nodes are unchecked. In the 'updateLayerVisibilityByNode' we just work on the selected node and its dependent layer. It should not be the case that other layers (besides base layers) are affected. As Marc already wrote: Is there any code we can see?

As short-term-solution you can either overwrite the 'updateLayerVisibilityByNode' function or you unbind it and bind your own 'checkchange'-handler.

Cheers
Chris
--
Christian Mayer
GIS-Spezialist & Software-Developer

meggsimum
Hauptstraße 165a  | 67125 Dannstadt-Schauernheim
i...@meggsimum.de  |www.meggsimum.de
Am 03.09.2015 um 17:02 schrieb Marc Jansen:
Hi Seth,

when you say 'previously', what version are your refering to?

Is there code one can see for your approach towards 'parameter nodes'?

Thanks for the feedback!

Best,
Marc

On 03/09/15 12:29, geographika wrote:
Hi devs,

I have been testing the 2.1 version with my codebase and have run into a few issues with the new approach to layer visibility and node synching in the GeoExt.tree.Panel Previously updateLayerVisibilityByNode was handled by the different node plugins. In 2.1 it is moved into the GeoExt.tree.Util class, and applied to "checkchange" events for all nodes in the tree.

See:

https://github.com/geoext/geoext2/blob/master/src/GeoExt/tree/Panel.js
https://github.com/geoext/geoext2/blob/master/src/GeoExt/tree/Util.js

However this means other custom layer types, such as parameter nodes (that I'm trying to implement as a pull request), turn off whenever any of the nodes are unchecked. There doesn't seem to be an easy way to override this (apart from removing the event from the whole tree). The updateLayerVisibilityByNode takes into account "isBaseLayer", but maybe some other property could be added to allow skipping or overriding these checks?
Or is there another way?

Good luck with the upcoming release!

Regards,

Seth

--
web:http://geographika.co.uk
twitter: @geographika







_______________________________________________
Dev mailing list
Dev@geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/dev


--

   Dipl.-Geogr. Marc Jansen
   — Anwendungsentwickler —

   terrestris GmbH & Co. KG
   Pützchens Chaussee 56
   53227 Bonn

   Tel:   +49 (0)228 / 96 28 99 -53
   Fax:   +49 (0)228 / 96 28 99 -57

   Email:jan...@terrestris.de
   Web:http://www.terrestris.de

   Amtsgericht Bonn, HRA 6835, Komplementärin: terrestris Verwaltungs-
   gesellschaft mbH, vertreten durch: Hinrich Paulsen, Till Adams


_______________________________________________
Dev mailing list
Dev@geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/dev



_______________________________________________
Dev mailing list
Dev@geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/dev

_______________________________________________
Dev mailing list
Dev@geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/dev

Reply via email to