[Users] Layer tree based on WFSCapabilitiesStore

Denis Rykov rykovd at gmail.com
Sat Aug 13 12:13:04 CEST 2011


Thanks for help, I've solved my problem:

        <script type="text/javascript"
src="./libs/openlayers/OpenLayers.js"></script>

        <script type="text/javascript" src="./libs/geoext/GeoExt.js"></script>

        <script>
        var store, layerList, layerTree;
            Ext.onReady(function() {

                Ext.onReady(function() {

                    store = new GeoExt.data.WFSCapabilitiesStore({
                        url:
"http://map.rostmuseum.ru/scripts/tinyows/tinyows.cgi?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities",
                        listeners: {
                            load: function(mystore) {
                                layerList = new GeoExt.tree.LayerContainer({
                                    text: 'All Layers',
                                    layerStore: mystore,
                                    leaf: true,
                                    expanded: true
                                });

                                layerTree = new Ext.tree.TreePanel({
                                    title: 'Map Layers',
                                    renderTo: 'capgrid',
                                    root: layerList
                                });
                            }
                        }
                    });

                    store.load();
                });
            });
        </script>


More information about the Users mailing list