The WMS layes support a get legend graphics operation so you should be able to 
make a legend graphic from that.
There is an example request on the user guide wiki.

I had a bit of trouble with it myself as many WMS servers ignore your requested 
width and height and return a small image that is part of a larger icon + 
title. So in uDig I went to some trouble to extract a 16x16 icon if in fact the 
WMS ignored me and returned something larger then the 16x16 icon I asked for.

If you are interested the code is here:
- 
http://svn.refractions.net/udig/udig/trunk/plugins/net.refractions.udig.catalog.wms/src/net/refractions/udig/catalog/internal/wms/WMSGeoResourceImpl.java

For vector layers you need to roll up your sleeves and generate something - In 
uDig I used code to look at the SLD for the vector layers and generate an icon.
- 
http://svn.refractions.net/udig/udig/trunk/plugins/net.refractions.udig.ui/src/net/refractions/udig/ui/graphics/Glyph.java
 
- 
http://svn.refractions.net/udig/udig/trunk/plugins/net.refractions.udig.project.ui/src/net/refractions/udig/project/ui/internal/LayerGeneratedGlyphDecorator.java


If you could tame these two uDig specific examples into something for java 
swing we could add them to the gt-swing module (and it would be a great help).

I think the geoserver project also started drawing icons by hand based on SLD?

Jody

On 01/07/2010, at 7:51 AM, Parker, Peter R (DNR) wrote:

> Hello,
> I currently have a MapContent that contains some vector data layers and some 
> WMS source layers.  I want to create a Legend image based on the styles 
> associated with the features in the vector layers and combine that with 
> images created from the WMS GetLegendGraphic request for the WMS layers.  Any 
> suggestions?
>  
> Thank you,
> Peter
>  
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- 
> http://p.sf.net/sfu/sprint-com-first_______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to