3

I have a GeoExt application and looking for approaches for building tree configuration (in JSON format). Now tree configuration is made manually and looks like:

    var treeConfig = new OpenLayers.Format.JSON().write([
    {
        text: "Layers",
        expanded: true,
        icon: "./images/Layers.png",
        children: [
            {
                text: "Nature",
                icon: "./images/globe.png",
                checked: false,
                group: true,
                children: [{
                    nodeType: "gx_layer",
                    layer: "Lakes",
                    icon: "./images/lake.png"
                },
                {
                    nodeType: "gx_layer",
                    layer: "Bogs",
                    icon: "./images/bog.png"
                }]
            }
            ...

But I would like to have web-application which I can use for building such configuration. All layers are published as WFS layers and it is possible to get the list of layers using GetCapabilities request, for example. Please give me any advice or may be known approaches how I can solve my problem.

2

There is also the LayerTreeBuilder ux. Check out the sources from http://svn.geoext.org/sandbox/mapgears/geoext.ux/ux/LayerTreeBuilder/ and see an example here: http://dev.geoext.org/sandbox/mapgears/geoext.ux/ux/LayerTreeBuilder/examples/tree-builder.html

0

GeoEXT has this example: wms-tree

(which can easily be modifed for WFS rather than WMS)

This example shows how to use GeoExt.tree.WMSCapabilitiesLoader to populate a tree with the hierarchical structure of a WMS GetCapabilities response. The example also shows how to customize the loader's createNode method to add a checkbox with a checkchange listener that adds and removes layers to and from the map.

http://api.geoext.org/1.0/examples/wms-tree.html

But you will have to customise this yourself - there is no 'WebApp' to do this currently.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.