我正在使用 GeoExt(基于 ExtJs)来创建一棵树。在每个节点中,我想要左侧的相应图像,而不是 像这个站点这样的默认图像。我该怎么做?
编辑
我找到了这个例子,但我不知道如何添加孩子
编辑 2 这是我的代码的一部分:
var bpn = new OpenLayers.Layer.WMS("bpn",
url,
{
LAYERS: [ 'Año 2004', 'Año 2005', 'Año 2006', 'Año 2007', 'Año 2009'],
format: "image/png",
transparent: "true",
projection: 'EPSG:4326'
},
{
buffer: 0,
displayOutsideMaxExtent: true,
isBaseLayer: false,
displayInLayerSwitcher: false,
yx: {'EPSG:4326' : true}
});
var treeConfig = [
{
nodeType: "gx_layer",
layer: bpn,
isLeaf: false,
loader: {
param: "LAYERS",
},
expanded: false
}];
tree = new Ext.tree.TreePanel({
border: true,
region: "west",
title: "Entre Ríos",
width: 250,
split: true,
collapsible: true,
collapseMode: "mini",
autoScroll: true,
loader: new Ext.tree.TreeLoader({
applyLoader: true,
uiProviders: {
"layernodeui": LayerNodeUI
}
}),
root: {
nodeType: "async",
children: treeConfig
},
rootVisible: false,
lines: false,
});
每一层(节点)'Año 2004', 'Año 2005', 'Año 2006', 'Año 2007', 'Año 2009'
都有不同的图像。我应该改变treeConfig
什么?