<>Hello Gabriel,
Sorry, I have sent this message yesterday but on the geotools-devel list...
>Anyway, I think that for classification maps there still makes sense to
>create the legend graphic dynamically. Indeed I guess it would be
>better.
>Don't know how fast you need this functionality, but it could be a good
>idea to work together on it.
>
That's the right problem, I need a fast solution. Otherwise it is sure
that a dynamic legend graphic is necessary. For classification maps, we
certainly have to build a powerful SLD rules parser, and it is not yet
compatible with my planning. So my static image choice. But when I will
have more time, I would really enjoy contributing on that.
Nevertheless, my first problem was retrieving a (dynamic or static)
legend graphic URL in the GetCapabilities document. As I said, I need a
fast solution, so I have made some little change in my own side. But I
can submit you what I have done.
First, I have modified the info.xml schema to include an <LegendURL>
optional section, as an example :
<><featureType datastore =" datastore3" >
<name>tribu</name>
<!--
native wich EPGS code for the FeatureTypeInfoDTO
-->
<SRS>2982</SRS>
<title>tribu_Type</title>
<abstract>Generated from datastore3</abstract>
<numDecimals value =" 8" />
<keywords>datastore3 tribu</keywords>
<latLonBoundingBox dynamic =" false" miny =" 7667294.0" maxy ="
7688957.0" maxx =" 486948.0" minx =" 440000.0" />
<!--
the default style this FeatureTypeInfoDTO can be represented by.
at least must contain the "default" attribute
-->
<styles default =" blue" />
<LegendURL width="72" height="72">
<Format>image/png</Format>
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:type="simple"
xlink:href="http://www.espace.ird.nc/legend/legend.png"/>
</LegendURL>
</featureType>
The <LegendURL> element has the same schema than in the GetCapabilities
one. By the way, is it right that all your element names (except SRS)
begin with a lowercase ?
LegendURL section is optional and must be added by hand after the
graphical configuration in info.xml files for desired featureTypes. I
have no Struts skills so I have not added form objects in the WMS Styles
configuration pages.
To manage LegendURL I have modified or added some classes from your
05/10/2004 SVN version :
* org.vfny.geoserver.global.dto.FeatureTypeInfoDTO. Adding a
LegendURLDTO property. Modification at lines 101, 147, 212, 263, 684, 695.
* org.vfny.geoserver.global.dto.LegendURLDTO. Class added.
* org.vfny.geoserver.global.FeatureTypeInfo. Addind a LegendURL
property. Modif at lines 20, 39, 149, 176, 222, 992.
* org.vfny.geoserver.global.LegendURL. Class added.
* org.vfny.geoserver.global..wms.WmsCapabilitiesResponseHandler.
Adding <LegendURL> element. Modif at lines 34, 315.
All concerned files are attached in this mail...
See you
Charles