Ticket #22 (closed enhancement: fixed)

Opened 1 year ago

Last modified 1 year ago

tree nodes for layer management

Reported by: ahocevar Assigned to:
Priority: major Milestone: 0.5
Component: GeoExt.tree Version:
Keywords: Cc:
State: Commit

Description

The attached patch provides several node types for dealing with layers in a tree:

  • TriStateCheckboxNode: a node with a third checkbox state, which indicates if none, some or all of its children are checked
  • LayerNode: a node representing a layer
  • LayerContainer: a node populating ifself with the layers from the provided layer store
  • BaseLayerContainer: same as above, but only with base layers
  • OverlayLayerContainer: same as above, but only for overlays
  • LayerParamsNode: a node representing arrays of layer params (e.g. of OpenLayers.Layer.WMS). Can be used for layer grouping or for adding CQL filters.

The patch also contains an example where users can play around with the layer configuration.

Attachments

treenodes.patch (41.3 kB) - added by ahocevar on 03/03/09 01:53:50.
treenodes.2.patch (42.7 kB) - added by ahocevar on 03/24/09 14:01:03.
updated to work with trunk
22.patch (42.7 kB) - added by tschaub on 04/02/09 23:48:35.
updates to respect layer order
treenodes.3.patch (42.7 kB) - added by dwins on 04/16/09 19:05:48.
treenodes.4.patch (38.9 kB) - added by ahocevar on 05/06/09 13:24:58.
LayerNode, LayerContainer, BaseLayerContainer and OverlayLayerContainer with tests and example
22.2.patch (37.2 kB) - added by tschaub on 05/12/09 01:12:54.
trivially tweaked patch

Change History

03/03/09 01:53:50 changed by ahocevar

  • attachment treenodes.patch added.

03/03/09 01:54:50 changed by ahocevar

treenodes.patch depends on the latest patch for #4

03/04/09 16:13:48 changed by ahocevar

  • state changed from Review to Needs more work.

It should also be noted that there is still room for improvements, especially the following three:

  • The containers should not load nodes in the render method, but should use a custom loader to do that.
  • The code for finding layers by their name once they become available should be moved from the layer node to the layer store.
  • I was unable to find a way to make TristateCheckboxNode to inherit from Ext.tree.TreeNode instead of Ext.tree.AsyncTreeNode without taking the functionality to load children specified in the tree configuration. So it may be better to move the tristate functionality from the node into the ui, which could then be used by either an AsyncTreeNode or a plain TreeNode.

03/18/09 09:21:57 changed by ahocevar

  • state changed from Needs more work to Review.

The above notes shouldn't keep us from using these nodes, they are just a reminder that things can be improved. Moving these notes to a separate ticket and marking this ticket for review.

03/18/09 09:24:26 changed by ahocevar

Dependant ticket #24 created. Note that these refactorings won't have any impact on the API of the nodes.

03/24/09 14:01:03 changed by ahocevar

  • attachment treenodes.2.patch added.

updated to work with trunk

03/24/09 14:05:20 changed by ahocevar

  • state changed from Review to Needs more work.

03/24/09 14:16:43 changed by ahocevar

  • component changed from widgets.MapPanel to widgets.tree.

03/24/09 14:27:23 changed by ahocevar

(In [262]) updated to treenodes.2.patch, but only TristateCheckboxNode, LayerNode and LayerContainer (see #22)

04/02/09 22:47:14 changed by tschaub

(In [333]) Adding some docs for layerStore config property (see #22).

04/02/09 22:53:31 changed by tschaub

(In [335]) Adding a layer tree example (see #22 - requires wms cap reader)

04/02/09 23:00:20 changed by tschaub

Would be good for addLayerNode to take an index. And the index should be the child index for the node (not the record index in the store).

I'd also expect the first record in a layer store (bottom of draw order) to be at the bottom of the tree.

04/02/09 23:36:20 changed by tschaub

(In [336]) Respect layer order when adding to the container. (see #22)

04/02/09 23:48:35 changed by tschaub

  • attachment 22.patch added.

updates to respect layer order

04/16/09 19:05:48 changed by dwins

  • attachment treenodes.3.patch added.

04/16/09 19:06:43 changed by dwins

I found and fixed a bug with double-clicking; the LayerNode didn't support calling toggleCheck() with no arguments as expected by Ext.

04/16/09 19:07:33 changed by dwins

(In [402]) Fixed bug with double-click handling on layertree, see #22

04/23/09 11:17:49 changed by ahocevar

  • state changed from Needs more work to Review.

04/30/09 00:39:47 changed by ahocevar

  • owner set to ahocevar.
  • state changed from Review to Needs more work.

New patch with more tests and an example that follows our example coding style is in preparation, will upload tomorrow morning.

05/06/09 13:24:58 changed by ahocevar

  • attachment treenodes.4.patch added.

LayerNode, LayerContainer, BaseLayerContainer and OverlayLayerContainer with tests and example

05/06/09 13:33:36 changed by ahocevar

  • owner deleted.
  • state changed from Needs more work to Review.

The above patch does not contain the LayerParamsNode, but has verbose tests and should be a solid base for further improvements beyond milestone 0.1.

Tests pass in FF3 and IE7. Please review.

05/06/09 13:36:03 changed by ahocevar

Forgot to mention that the latest patch also does not contain the TristateCheckboxNode. BTW, the reason for the reduced feature set of the latest patch is that some advanced features from previous patches have not been discussed/tested enough.

05/12/09 01:12:54 changed by tschaub

  • attachment 22.2.patch added.

trivially tweaked patch

05/12/09 01:14:01 changed by tschaub

  • state changed from Review to Commit.

Looks good Andreas. Thanks for the work on this. Only change in my patch was to use CacheFly in the example (see #61).

Please commit.

05/18/09 22:50:48 changed by ahocevar

  • status changed from new to closed.
  • resolution set to fixed.

(In [808]) added tree nodes and containers. r=tschaub (closes #22)