<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi all,<br>Is it possible to show non-Geoserver defined styles in the LegendPanel? (sld file is non existent)<br>For a layer straight out of Geoserver this is no problem, I understand the corresponding sld is consulted to define the entry in the lgend.<br>I have a query facility where the user specifies on the fly which attributes he would like to see in a given layer, and how he would like them styled (color, radius etc.).<br>The layers display fine on the map and in the layer tree, but I would like to add a corresponding entry in the legend panel. At present only the layerName shows, but no icon(s).<br>Some code extracts are included below.<br>Any tips or hints would be gratefully received,<br>Thanks,<br>Eoin<br><br>An extract from the code used to specify the style parameters for the layer is as
follows:<br><br> queryLayer.mergeNewParams({<br> sld_body: new OpenLayers.Format.SLD().write({<br> namedLayers: [{<br> name: panel.selectedLayer.get("name"), <br> userStyles: [style]
<br> }]<br> })<br> });<br> map.addLayer(queryLayer);<br><br>The user's style is constructed as follows:<br><br>style = new OpenLayers.Style("", {rules: [<br> new OpenLayers.Rule({<br>
title: "generic point rule",<br> filter: panel.getFilter(), //append the criteria specified by the user (attributes + their values)<br> symbolizer: {<br> "Point":
{<br> pointRadius: hilightsize, // user defined<br> graphicName: "circle",<br>
fillColor: hilightcolor, // user defined<br> fillOpacity: 0.75,<br> strokeWidth: 1,<br>
strokeOpacity: 0.75,<br> strokeColor: "#000000"<br>
}<br> }<br> })<br> ]//close rules array<br> }); //close var definition <br></td></tr></table><br>