Thanks for the input I can try that to change the icon and style. However, what I really wanted to do is to manage to have base layers such as yahoo and Google to show up in my legend tree along with the 'overlay' layers. I did not manage to have the tree working and show up at all once I add yahoo or Google layers to the map. The tree below works and shows the OSM base layer fine along with the overlay layers Note that I do not need legend icons for the base layers only for the overlay layers (as is right now). So my question is how to make the legend tree work when I have Google and yahoo layers in my map ? (right now it does not work any more and does not show up in the UI once I add Google or yahoo layers). Karsten _____
From: IT Intern [mailto:[email protected]] Sent: Friday, January 07, 2011 09:57 To: karsten vennemann Subject: Re: [Users] GeoExt Legend Tree and base layers ? Hello Karsten, If I understand correctly, you want to change the icons of your tree panel nodes? I did this, but I didn't use the UI as you did so what I tell you may or may not help (but hopefully it will :) ) You have to change the node's iconCls, you can do this when the node is instantiated or after suing something like: node.setIconCls("yourNodeClass"); Then in CSS you should: .x-tree-node img.yourNodeClass, .x-tree-node-collapsed img.yourNodeClass, .x-tree-node-expanded img.yourNodeClass{ background: url("yourImageLocation"); } Hope this helps, elshae On Fri, Jan 7, 2011 at 12:21 PM, karsten vennemann <[email protected]> wrote: Hi, really nobody has a hint how to do this ? Karsten _____ From: karsten vennemann [mailto:[email protected]] Sent: Wednesday, January 05, 2011 16:12 To: '[email protected]' Subject: GeoExt Legend Tree and base layers ? Hi all, have a GeoExt Legend Tree below and wanted to enable more base layers to be shown (no legend needed for those in) it too. The one below work already with OSM and shows up as a radio button. Now I would like to add back into my app google and yahoo base layers. However, if I just add them to Openlayer the tree does not show anything any more. What do I need to change in my tree legend below to enable base layers otehr than OSM to work. I tried adding a nodeType: "gx_baselayercontainer" but could not gte it to work. It will be something like in http://api.geoext.org/1.0/examples/tree.html but with legend icons ... I have this : var tree = new Ext.tree.TreePanel({ title: "Ebenen", width: 250, autoScroll: true, enableDD: true, // apply the tree node component plugin to layer nodes plugins: [{ ptype: "gx_treenodecomponent" }], loader: { applyLoader: false, uiProviders: { "custom_ui": LayerNodeUI } }, root: {nodeType: "gx_layercontainer", loader: { baseAttrs: { uiProvider: "custom_ui" }, createNode: function(attr) { // add a WMS legend to each node created attr.component = { xtype: "gx_wmslegend", layerRecord: mapPanel.layers.getByLayer(attr.layer), showTitle: false, // custom class for css positioning // see tree-legend.html cls: "legend" } return GeoExt.tree.LayerLoader.prototype.createNode.call(this, attr); } } }, rootVisible: false, lines: false }); Thanks Karsten _______________________________________________ Users mailing list [email protected] http://www.geoext.org/cgi-bin/mailman/listinfo/users
_______________________________________________ Users mailing list [email protected] http://www.geoext.org/cgi-bin/mailman/listinfo/users
