Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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