<div dir="ltr">Thank you Arnd,<div><br></div><div>Using SLD worked perfectly. I created my SLD file in QGIS and then used that for each attribute in the polygon object in GeoServer.</div><div>Next, I need to figure out how to show this legend in OpenLayers. </div>
<div><br></div><div>Andreas</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-08-05 20:22 GMT+02:00 Arnd Wippermann <span dir="ltr"><<a href="mailto:arnd.wippermann@web.de" target="_blank">arnd.wippermann@web.de</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial">you could use SLD for WMS to accomplish this
task.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial">most likely you have to create a sld file for every attribute
you wish to visualize.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial">An example, that shows different styling for the same layer
based on different rules (not always by attribute)</font></span></div>
<div><font color="#0000ff" face="Arial"><a href="http://gis.ibbeck.de/ginfo/apps/OLExamples/OL210/MapServer_SLD_World/MapServer_SLD_World.asp" target="_blank">http://gis.ibbeck.de/ginfo/apps/OLExamples/OL210/MapServer_SLD_World/MapServer_SLD_World.asp</a></font></div>
<div><font color="#0000ff" face="Arial"></font> </div>
<div><span><font color="#0000ff" face="Arial">Regards,</font></span></div>
<div><span><font color="#0000ff" face="Arial">Arnd</font></span></div>
<div><br></div>
<div dir="ltr" lang="de" align="left">
<hr>
<font face="Tahoma"><b>Von:</b> <a href="mailto:openlayers-users-bounces@lists.osgeo.org" target="_blank">openlayers-users-bounces@lists.osgeo.org</a>
[mailto:<a href="mailto:openlayers-users-bounces@lists.osgeo.org" target="_blank">openlayers-users-bounces@lists.osgeo.org</a>] <b>Im Auftrag von </b>Andreas
Forø Tollefsen<br><b>Gesendet:</b> Dienstag, 5. August 2014 14:51<br><b>An:</b>
<a href="mailto:openlayers-users@lists.osgeo.org" target="_blank">openlayers-users@lists.osgeo.org</a><br><b>Betreff:</b> [OpenLayers-Users] Class
based fill of polygons<br></font><br></div>
<div></div>
<div dir="ltr"><div class="">Hi all,
<div><br></div>
<div>I am new to OpenLayers (so forgive me in advance). </div>
<div><br></div>
<div>I have a polygon layer in GeoServer (from a shapefile) consisting of 487
features and 15 statistical attributes of socio-economic variables.</div>
<div>What I want to accomplish is to visualize these 15 variables in a web map
service, where the user can select the variable he/she wants to visualize and
that the color fill represents low to high on the selected variable (white to
dark grey i.e.).</div>
<div><br></div>
<div>So far I have managed to set up an OpenLayers page that reads the GeoServer
layer, and outputs the attribute table below the map when I click one of the
features.</div>
<div><br></div>
<div>However, I am still lost as to how I should proceed to create the
visualization.</div>
</div><div>One example of an end-result could look similar to this: <a href="http://sedac.ciesin.columbia.edu/maps/client" target="_blank">http://sedac.ciesin..columbia.edu/maps/client</a></div><div class="">
<div><br></div>
<div>So my question is. What styling code am I looking for, and could this type
of solution be created out of the one layer, or do I need one layer for each
attribute?</div>
<div>And if I need to create a rule based class interval, do I have to do this
manually for each class, for each attribute?</div>
<div><br></div>
<div>Any example code that points to the suggested direction would be
great!</div>
<div><br></div>
<div>thanks!</div>
<div><br></div>
<div>Best,</div>
<div>Andreas</div>
<div><br></div></div></div>
<br><br>
<hr style="border:none;color:#909090;background-color:#b0b0b0;min-height:1px;width:99%">
<table style="border-collapse:collapse;border:none">
<tbody><tr>
<td style="border:none;padding:0px 15px 0px 8px">
<a href="http://www.avast.com/" target="_blank">
<img border="0" src="http://static.avast.com/emails/avast-mail-stamp.png">
</a>
</td>
<td>
<p style="color:#3d4d5a;font-family:"Calibri","Verdana","Arial","Helvetica";font-size:12pt">
Diese E-Mail ist frei von Viren und Malware, denn der <a href="http://www.avast.com/" target="_blank">avast! Antivirus</a> Schutz ist aktiv.
</p>
</td>
</tr>
</tbody></table>
<br>
</div>
</blockquote></div><br></div>