Hello GeoExt users,
I have an Ext.tree.TreePanel that I later add a layer to one of it's child
containers after that container has been created. The child container is an
GeoExt.tree.OverlayLayerContainer. The two things that I am struggling with
are how to set the tree nodes of an GeoExt.tree.OverlayLayerContainer to
radio buttons instead of checkboxes? and how do I add nodes later on to the
container? My attempt at this is below:
function childContainer(text, layerStore, parent, iconCls){
parent.appendChild(new GeoExt.tree.OverlayLayerContainer({
text: text,
layerStore: layerStore,
expanded: true,
iconCls: iconCls, //If not specified, defaults to original image
loader: {param: "LAYERS"}
}));
}//end childContainer
//Container for photo layers
childContainer("Photo Layers", photoLayers, layerRoot);
//In another function
map.addLayer(vectorPano);
layerStore.loadData([vectorPano], true);
var panoNode = new Ext.tree.TreeNode({
leaf: true,
text: 'Panoramio Photos',
checked: false
});
panoNode.addListener("radiochange", function(){
vectorPano.setVisibility(true);
});
var layerContainer = layerRoot.findChild('text', 'Photo Layers');
layerContainer.appendChild(panoNode);
Currently a node is added, but it is a checkbox and when it is clicked on
and off it does not turn the layer on/off. I'd prefer radio buttons nodes..
Thank you for your time,
elshae
_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users