Hi there,
Sorry for the re-post but I am hoping this may generate a response as I am
struggling at the moment.
We have an app with a map with multiple layers, containing multiple sub-
layers. With MapFish we generate some json where the layerNames attribute is
set to the layer:sub-layer e.g.
return [{
text: 'Clear/Select all Layers',
leaf: true,
layerNames: ['Marine'],
iconCls: 'no-icon',
checked: true
}, {
text: 'Bathymetry & Elevation',
leaf: false,
layerNames: ['Marine:57000'],
iconCls: 'no-icon',
expanded: false,
checked: true,
children: [{
text: 'Bathymetry',
leaf: true,
layerNames: ['Marine:56500'],
iconCls: 'no-icon',
expanded: false,
checked: true,
children: [{
text: 'Depth Area',
leaf: false,
layerNames: ['Marine:56000'],
iconCls: 'no-icon',
checked: true,
children: [{
text: 'Depth Area Text',
leaf: true,
layerNames: ['Marine:55701'],
icon: serverUrl +
'legend_icons/bgs625k/2010_625k_bed_APP_46165.png',
checked: true
}, {
text: 'Undefined Depth',
icon: serverUrl +
'legend_icons/bgs625k/2010_625k_bed_APP_46165.png',
leaf: true
}, {
text: 'Intertidal',
icon: serverUrl +
'legend_icons/bgs625k/2010_625k_bed_APP_46165.png',
leaf: true
....
}];
When constructing the map initially we supply it with a number of parameters
e.g.
var params = {
transparent: true,
layers: [ 57000, 56500, 56000, 55701 ],
format: 'image/png',
srs: 'EPSG:27700'
};
var layer = new OpenLayers.Layer.WMS("Marine")", urls, params, options);
The numbers in the layers attribute correspond to layerNames in the tree model
prefixed with the name of the layer e.g. Marine.
When the checkbox is clicked on the LayerTree, the map contacts the WMS(s) and
gets all the layers with the checkboxes ticked, displaying only the layers the
user wants.
I have migrated most of our code away from MapFish, this being the last bit,
but like I said I'm struggling to see how to do this with GeoExt. We must get
the legend from the server as it gets the data from a database and generates
the json string.
>From the examples in GeoExt I can't see where we can specify a different icon
for each leaf node of the tree or tie the node to a sub-layer of the map.
Any ideas/examples would be appreciated, thank you.
MARK
CIAO
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users